Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
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
Contributor
June 14, 2022 edited

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
Contributor
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
atlassian, atlassian community, journeys for jira service management, journeys for jsm, eap jsm atlassian, early access program atlassian, early access program journeys atlassian, early access program journeys jira service management, join atlassian eap

Join the Early Access Program (EAP) - Journeys for Jira Service Management 🚪

Journeys is a brand new feature in Jira Service Management that helps you streamline various processes in your organization that may cross multiple departments, such as employee onboarding or off-boarding that require action from different teams. ✨

Join the EAP →
AUG Leaders

Upcoming Jira Service Management Events