Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue


Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Page status

Status
colourGreen
titlecomplete

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



Panel

On this page

Table of Contents
maxLevel2
exclude(On this page|Use case).*
typeflat
separatorpipe



UI Text Box
sizemedium
typeinfo

Use case

In this example, a custom identifier "Approval Code" is added to issues by using a project property and different custom fields.

The code that will be created is a combination of a specific number (sequence number), the fiscal year (custom field), and the abbreviation of a department.

Configuration items needed:

  • Project property "sequenceNumber"
  • Custom Text Field "Department"
  • Custom Text Field "Fiscal Year"
  • Custom Text Field "Approval Code"

Excerpt Include
Calculate custom sequence numbers
Calculate custom sequence numbers
nopaneltrue

Prerequisites

UI Text Box
typeinfo

In order to make this use case working, the project property sequenceNumber has to be set initially.


UI Expand
titleSet up the project property


UI Steps


UI Step

Head over to the project you want to create the project property in.


UI Step

Head over to Project settings → Details


UI Step

Add the following text to the project description:

Code Block
{sequenceNumber=1}






Configuration

UI Steps


UI Step

Set the approval code

UI Steps


UI Step

Add the Update or copy field values post function to the desired transition or create a new transition.


UI Step

Target issue

Choose Current issue


UI Step

Fields

UI Steps


UI Step

Field

Select the field you want to write the approval code to.


UI Step

Value

Choose Set field value manually


UI Step

Expression

Add the following expression with mode set to Advanced text:

Code Block
linenumberstrue
%{issue.cfaaaaa} + "/" + toUpperCase(substring(%{issue.cfbbbbb}, 0, 3)) + "/" + substring("000", length(projectProperty("sequenceNumber")), 3) + projectProperty("sequenceNumber")


UI Expand
titlemore info...


UI Text Box
typeinfo

The following field codes are used:

  • %{issue.cfaaaaa} is the field code for the field Fiscal year.
  • %{issue.cfbbbbb} is the field code for the field Department.


The department will be returned in the following format:

Value in field "Department"Value returned by the expression
DevelopmentDEV
SalesSAL
MarketingMAR

The expression will only grab the first three letters and write them in upper case by using substring() and toUpperCase().


In our case we want the sequenceNumber to be a 3-digit number. Therefore the following expression is used:

Code Block
linenumberstrue
substring("000", length(projectProperty("sequenceNumber")), 3)

It takes the length of the sequenceNumber and dynamically adds zeros to fill up the sequenceNumber to a 3-digit number.

Example:

"sequenceNumber" project propertyAdded zerosOutput
12001
101010
1000100

The used functions are substring()length() and projectProperty().



Excerpt


UI Text Box
typetip

The final approval code might look something like this:

Code Block
2021/DEV/023





UI Step

Field

In addition, select the Temporary number 1 field.


UI Step

Value

Choose Set field value manually


UI Step

Expression

Enter the following expression:

Code Block
linenumberstrue
toNumber(projectProperty("sequenceNumber")) + 1







UI Step

Update the "sequenceNumber" project property

UI Steps


UI Step

Add the Set or create JWT project property underneath the previous post function.


UI Step

Mode

Choose Create the property and assign the value


UI Step

Property key

Enter

Code Block
linenumberstrue
sequenceNumber



UI Step

Property value

Enter

Code Block
linenumberstrue
%{issue.temporaryNumber1}







Screenshots


Related use cases

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Parser functions, Label
sortByTitle
cqllabel = "use-case-workflow" and space = "JWTSDC" and ancestor = "27066660"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue