Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,492
Community Members
 
Community Events
165
Community Groups

Populate (append) Approvers from two different user picker fields

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

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
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

188 views 0 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you