Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Populate (append) Approvers from two different user picker fields

Vlatko Bojkovski June 14, 2022

Hi All,

 

I would need help with configuring a JSON in the advanced section of the Automation rule.

 

I have an automation that creates 26 tickets when a certain request type is created. On the trigger request type, there are 6 user picker fields (all different types of approvers which are combined differently in the 26 tickets)

I have an issue populating the Approvers field in the different 26 tickets based on the main request type.

The Approvers cannot be added in the approval step in the workflow from two different user picker fields, only from one is allowed.

That is why I turned to the Automation route, where I should be able do it, in the JSON section. However, all the time, I am being prompted with the "Error while parsing additional fields. Not valid JSON." message in the logs.

Below is the code I am using, where customfield_10003 is the system Approvers field, and the other two, from where it should be populated are single user picker fields:

 

{
"fields": {
"customfield_10003" : [ {"accountId": {{triggerissue.fields.customfield_10908.accountId}}}, {"accountId": {{triggerissue.fields.customfield_10909.accountId}}}]
}
}

 

I have checked the issue values with the Rest call: https://mysitename.atlassian.net/rest/api/3/issue/XXX-99, and that is how I know that Approvers is using accountId for distinguishing users (Cloud) 

I tried without the "triggerissue.fields." part, by copying the values of the single user picker fields from the main request type into one of  the 26, but no avail.

 

Any help would be appreciated.

Thanks a lot in advance.

 

Kind Regards,

Vlatko

1 answer

1 accepted

3 votes
Answer accepted
Vlatko Bojkovski June 15, 2022

Hi All,

 

Just an update that I have resolved this.

 

The problem was that the {{triggerissue.fields.customfield_10909.accountId}} part was not enclosed with quotation marks. It was getting the id correctly, but when populating the accountID in customfield_10003, it must be enclosed in quotation marks.

 

The code below is correct:

{
"fields": {
"customfield_10003" : [ {"accountId": "{{triggerissue.fields.customfield_10908.accountId}}"}, {"accountId": "{{triggerissue.fields.customfield_10909.accountId}}"}]
}
}

 

Thanks and KR,

 

Vlatko

Suggest an answer

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

Atlassian Community Events