Forums

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

Jira Automation setting value of Multi Select list

shane-nz
March 16, 2026

I am trying to dynamically set the value of a customfield_12000 (multi select list) based on the following, the automation runs (whilst testing) manually


currently I have created a smart value variable finanicalYear with the following logic
{{#if(equals(now.format("MM"), "01"))}}FY26Q1{{/}}
{{#if(equals(now.format("MM"), "03"))}}FY26Q2{{/}}
{{#if(equals(now.format("MM"), "07"))}}FY26Q3{{/}}
{{#if(equals(now.format("MM"), "10"))}}FY26Q4{{/}}

so when the automation runs it sets finanicalYear to "FY26Q2", I can validate this in eth Audit Log as well as the value being used in the Summary field 

I then step to Create an issue

however when trying to set my the customfield_12000 (within the same branch), it does not want to apply. I have tried on the Create action and the Edit Action. 
I have tried to assign the value in the JSON, but initially the wizard rejected my attempt as invalid JSON.

The value being set is a valid option in in the contexts 

 

2 answers

1 accepted

3 votes
Answer accepted
Trudy Claspill
Community Champion
March 16, 2026

Hello @shane-nz 

Sometimes the problem with an automation rule not working as expected is related to the context of the rule step. Please provide screen i.ages showing your entire rule and the details of the steps where you create the variable and steps where you use the variable.

shane-nz
March 16, 2026

Screenshot 2026-03-17 160838.png

shane-nz
March 16, 2026

Ideally I want to reference the conditional value of financialYear like this
Screenshot 2026-03-17 161153.png 

Trudy Claspill
Community Champion
March 16, 2026

You said the custom field is a multiple selection field. Are you wanting to add this as another value selected, or overwrite what is in the field with the new value?

Does the field already include in its list of selectable values the value to which you are trying to set the field?

shane-nz
March 16, 2026

I am wanting to dynamically set the value of this field so when run in July it set the value to FY26Q3 and when run in October it sets it to FY26Q4

The automation is a "Create process" so the value would be set the initial option. 

Yes this value does exist.   

Trudy Claspill
Community Champion
March 16, 2026

Can you share the JSON you used?

shane-nz
March 17, 2026
Screenshot 2026-03-18 092537.png

{
"fields": {
"Planned For": {
"value": "{{financialYear}}"
}
}
}

shane-nz
March 17, 2026

I have used the Advanced JSON editing to set the Planned For field with a static string.

Where the string value is a valid option.

{
"fields": {
"Planned For": [{"value" : "FY26Q1"}]
}
}

 just looking for the ability to inject the smart-value variable I created in the automation

shane-nz
March 17, 2026

This format has set the value in my field


{
"fields": {
"Planned For": [{"value": {{financialYear.asJsonString}}}]
}
}

 Will run through a few tests now and get back 

Trudy Claspill
Community Champion
March 17, 2026

Your original code would not have worked, I think, because you said that the field is a multiple selection field and your code didn't include the square brackets around the array of values.

{
"fields": {
"Planned For": [{
"value": "{{financialYear}}"
}]
}
}

 

Make sure that you do not also have Planned For specified outside of the JSON; i.e. having selected it from the Choose fields to set list.

Like # people like this
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 Champions.
March 17, 2026

Hi @shane-nz 

With the date / time format function, you could get that financial quarter value in one step:

FY{{now.format("yyqqq")}}

This would work for any date, regardless of the current month.  For example, for a date in February it would correctly return FY26Q1.

 

Please note well: that expression uses the yy format for years based on the calendar.  If instead you use week-based years, try YY.

 

Kind regards,
Bill

shane-nz
March 17, 2026

Let me try this

Trudy Claspill
Community Champion
March 17, 2026

Note that the reference document from @Bill Sheboy (who is, by the way, an Automation Rules genius) was for Jira Cloud. Per the post tags Jira Server/Data Center is being used.

The reference document for Jira Server/Data Center is here 

It looks like the information is the same, though.

Like # people like this
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 Champions.
March 17, 2026

Oops...thanks, @Trudy Claspill :^)

Like Trudy Claspill likes this
shane-nz
March 17, 2026

The above resulted in FY261, my company needs the FY26Q1.

I could be doing something wrong, its been known to happen. I suppose a clumsy alternative could be 

FY{{now.format("yy")}}Q{{now.format("qqq")}} 

 

shane-nz
March 17, 2026

Thanks @Bill Sheboy We'll get to the cloud one day soon...

Trudy Claspill
Community Champion
March 17, 2026

From the reference document if you drill down to the Java documentation I recommend trying "qq".

Q = 3

QQ = 03

qq = Q3 (I believe)

qqqqqqqqqqq = 3rd quarter (maybe?)

 

Partial list from the Java documentation:

Screenshot 2026-03-17 at 2.23.21 PM.png

Like # people like this
shane-nz
March 17, 2026

Got it ....with a combination of reading the documentation, experimentation and your wise words.



FY{{now.format("yyQQQ")}}

Like Bill Sheboy likes this
Trudy Claspill
Community Champion
March 17, 2026

Huh, that is not what I would expect to work since the docs say

Q/q >> number/text

I would expect QQQ to give you a strictly numeric result.

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 Champions.
March 17, 2026

Yes, and...this is why we experiment when using automation rules.  :^)

Although the automation docs for Cloud and Server / Data Center may state things like "just like Java" or the "underlying implementation is based on Java's..." there are demonstratable differences.  For one example, some of the regex stuff is different...possibly due to how the rule engine parses expressions (before / after escaping tokens) and racetrack timing impacts.

The smart value expression I suggested for the quarter information worked for Jira Cloud as of 17 March 2026 at 1325 PT, but I did not test it for Server or Data Center's various automation versions.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events