Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

In Jira Automation, is there a way that I can assemble a field name and use that in a smart value

Cash Coyne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2024

In Jira Cloud Automation, is there a way that I can assemble a field name and then use that in a smart value?

I have a manually triggered rule where the user enters a text value called Stream and a number value called TotPoints

I know I can access the Stream value using userinputs.Stream

Now, I have a number of Custom Fields of type number with the names in the format "Category-Stream" where Stream can be any one of the following: Dev, QA, Support, IT.

So I have these custom fields:

  • Category-Dev
  • Category-QA
  • Category-Support
  • Category-IT

What I want to do is create a variable in automation so that I can access the value of the Custom field that matches userinputs.Stream entered.

For example, instead of using this:

{{#=}}{{issue.Category-Dev}}+{{userinputs.TotPoints}}{{/}}

I'd like to substitute the userinputs.Stream value for the Dev, kind of like this?

{{#=}}{{issue.Category-{{userinputs.Stream}}}}+{{userinputs.TotPoints}}{{/}}

Will that work?  And if not, how can I do it?

 

 

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2024

Hi @Cash Coyne 

Short answer: I do not believe it is possible.

Some work-arounds would be:

  • using a lookup table, populated with all the fields of interest, then use the user input in the get() function to get the value(s)
  • using conditional logic in a string of values, such as with {{#if(equals(userInputs.Stream,"Dev"))}}{{issue.Category-Dev}}{{/}}
  • using if / else conditions to select the field(s), using them immediately or setting a variable for later use

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events