Jira Automation - Edit issue multi user picker field

Arthur S March 2, 2022

Hi,

 

I am trying to use the Jira automation to edit a multi user picker field. What I am trying to achieve is, when people "approve" the ticket using the transition, I have an automation which add the user to my multi user picker cf "approved by" and it remove him from "approvers". 

 

I am using the following but can't make it work properly :

jira_automation.PNG

 

and I have the following code :

{ 
"update": {
"approved by": [{
"set": {{initiator.accountId.asJsonObject("id")}}
}]
}
}

 

can you please help me ?

 

Thanks, 

1 answer

1 accepted

2 votes
Answer accepted
d_kirsching March 2, 2022

Hi @Arthur S 

Maybe the smart value {{approval.approver}} is your solution.

Capture d’écran 2022-03-02 à 12.15.40.png

Regards

Arthur S March 2, 2022

Hi @d_kirsching thank you, I found the right solution, I tried your proposal and it did not add the user to the list. But based on what you proposer, I tried with {{initiator.accountId}} instead in the "Request participants" field, and it adds me my user.

 

Hi now need to find how to remove the user from the "approvers" field. Any idea ? I have the following code :

{
"update": {
"approvers": [{
"remove": {{initiator.accountId}}
}]
}
}

 

Thank you,

Arthur

d_kirsching March 2, 2022

Hi @Arthur S 

Please find below the right code.

All informations for Advanced Fields Editing can be found here : 
https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Referencing-issue-fields

{
"update": {
"approvers" : [
{
"remove": {
"id":"{{initiator.accountId}}"
}
}
]
}
}

Regards 

Like Richard Scholtes likes this
Arthur S March 2, 2022

I also tried it earlier but this is not working. It shows a success but it's not removing the user from my field.

d_kirsching March 2, 2022

For me it'w working with the trigger Approval completed

 

Capture d’écran 2022-03-02 à 14.43.46.png

Arthur S March 2, 2022

I'm on Jira software and not Jira service management, so I don't have the "Approval completed". For me it should work on the Edit Issue but I don't know why, it's not.

Hana March 10, 2022

In case you didn't find your answer... this one worked for me:

 

 

{
  "update": {
     "Approvers" : [
       {
         "remove": {
            "name":"{{initiator}}"
        }
      }
   ]
}

Like # people like this
Arthur S March 11, 2022

Hi,

I tested it and that works.

Thank you

Yogesh Mude April 27, 2023

Hello @d_kirsching ,

I want to remove the initiator (who triggered it) from the Approvers field but with the above code, it's removing all the other users, not the initiator.

Any assistance will be appreciated.

Thank you in advance.

Harsh
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 Leaders.
November 14, 2023

Hi,

I am also facing the same issue, that I cannot either add or remove a user from multi user custom field. 


I am using 

Remove:


{
"update": {
"customfield_12345": [{
"remove": {"id":"{{1585625}}"}
}]
}
}

 

Add:
{
"update": {
"customfield_12345": [{
"remove": {"id":"{{1585625}}"}
}]
}
}

Is there something wrong in above, am I missing something?

Thanks!

Suggest an answer

Log in or Sign up to answer