Forums

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

JSM automation : Edit issue field from Insight object multiple field

MrUpsidown
Contributor
July 21, 2022

I am having a hard time setting a field value in Automation. I read the following docs but could not get it to work.

https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html

On my issues, I have a custom text field called "Customer address" and a custom Insight object field called "Site", which accepts multiple values.

I created an automation rule to set the "Customer address" field value from the custom Insight object field when the Site field value changes.

I set the field value as 

{{issue.Site.Name}} - {{issue.Site.Address}}

The insight objects "Site" look like this :

Site 1
Name : Site 1
Address : ABC

Site 2
Name : Site 2
Address : XYZ

When the Insight object field has only one value (Site 1) the value copied is : "Site 1 - ABC" which is correct.

But if the Insight object field has 2 values (Site 1 and Site 2) the value copied is : "Site 1, Site 2 - ABC, XYZ" where I would expect to have "Site 1 - ABC, Site 2 - XYZ".

Any idea how I can achieve that?

 

1 answer

1 accepted

2 votes
Answer accepted
MrUpsidown
Contributor
July 21, 2022

As usual, it's when you ask that you get it to work...

{{#issue.Site}}{{Name}} - {{Address}}{{^last}}, {{/}}{{/}}

Will set the value to 

  • Site 1 - ABC

when there is only 1 value, and

  • Site 1 - ABC, Site 2 - XYZ

when there are multiple values

This page helped.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events