Supported list types


Number list

This function returns the numeric reference value of a given text

If this textKey does not exist in the textList, the function returns the last value of the referenceNumberList, if the referenceNumberList has one value more than the textList, otherwise


getMatchingValue(textKey, textList, referenceNumberList) #Output: Number



Parser expressionDescription


%{getMatchingValue(%{issue.priority}, ["High", "Medium", "Low"], [3, 2, 1])}


This example returns the correct number depending on the current priority.

This example could be used e.g. in the Update fields post function to set a specific field depending on the current priority.



%{getMatchingValue("Critical", ["Normal", "High", "Critical"], [1, 5, 20])}


This example returns:

20


%{getMatchingValue("None", ["Normal", "High", "Critical"], [1, 5, 20, 0])}


This example returns 

0

The textKey "None" is not available in the textList, so the last value of the referenceNumberList is returned (it has one more value than the textList).


%{getMatchingValue("Three", ["One", "Two", "Three", "Four", "Five"], [1, 1+1, 3*1, 4, 4+1])}


This example returns:

3



Parameters used in this function

ParameterInput (data type)Description
textKey

A text that exists in the textList.
textList

Any given text list.
referenceNumberList

Any given number list.



This function returns a




Variant with a numberKey and two number lists.


getMatchingValue(numberKey, numberList, referenceNumberList) #Output: Number



Parser expressionDescription


%{getMatchingValue(5, [1, 3, 5, 7, 9], [1, 1+1, 3*1, 4, 4+1])}


This example returns:

3


%{getMatchingValue(3, [1, 5, 7, 9], [1, 2, 3, 4, 99])}


This example returns:

99

The numberKey 3 is not available in the numberList, so the last value of the referenceNumberList is returned (it has one more value than the numberList).



Parameters used in this function

ParameterInput (data type)Description
numberKey

A number that exists in the numberList.
numberList

Any given number list.
referenceNumberList

Any given number list.



This function returns a


 


Text list

This function returns the text reference value of a given text

If this textKey does not exist in the textList, the function returns the last value of the referenceTextList, if the referenceTextList has one value more than the textList, otherwise an empty text.


getMatchingValue(textKey, textList, referenceTextList) #Output: Text 



Parser expressionDescription


%{getMatchingValue("Spain", ["USA", "UK", "France", "Spain", "Germany"], ["Washington", "London", "Paris", "Madrid", "Berlin"])}


This example returns:

"Madrid"


%{getMatchingValue(%{issue.issueType}, ["Task", "Sub-Task", "Story"], ["This is the description for a Task.", "Description for a Sub-Task", "Here comes the Story."])}


This example returns the correct description depending on the current issue type.

This could be used e.g. in the Create issue or Update fields post function to set the description depending on the selected issue type.




Parameters used in this function

ParameterInput (data type)Description
textKey

A text that exists in the textList.
textList

Any given text list.
referenceTextList

Any given text list.



This function returns a




Variant with a number list.


getMatchingValue(numberKey, numberList, referenceTextList) #Output: Text



Parser expressionDescription


%{getMatchingValue(8, [2, 4, 6, 8, 10], ["Washington", "London", "Paris", "Madrid", "Berlin"])}


This example returns:

"Madrid"



Parameters used in this function

ParameterInput (data type)Description
numberKey

A number that exists in the numberList.
numberList

Any given number list.
referenceTextList

Any given text list.



This function returns a


Use cases and examples




Status
Tech review

Style guide




Short description

Returns a custom reference value for a given or text or number

Output

 

Available since

Label