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

Update Request Participants Field with Approver

David Kintzinger February 27, 2023

Our goal is to update the field "Request Participants" automatically with an automation whenever a ticket is approved by an approver
The necessary steps for adding the correct approval step where taken within the corresponding workflow. 

I can correctly get the approver who approved the ticket by adding [~accountid:{{approval.approver}}] into, for example, a comment. 

I read in this forum that updating the Request Participants field takes the following JSON Code:

{
"update": {
"Request participants": [
{
"add": { "name": "NameOfTheApprover" }
}
]
}
}


It is important for us to update the field and not to just set it because we need to keep customers who where already added to said field.


Altogether out current solution looks like this:

{
"update": {
"Request participants": [
{
"add": { "name": "{{approval.approver.displayName}}" }
}
]
}
}


In the automations Audit-Log this shows as succesfull, however it doesn't show up in the ticket. 
I already tried a lot of ways to get the approvers name and add it in this JSON Code (for example using the field identifiers from the corresponding REST Endpoint) but nothing worked so far.

Can anyone here help me with this issue? 

I already searched this forum and could not find any working solution.

Thanks!

2 answers

1 accepted

3 votes
Answer accepted
Rilwan Ahmed
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 27, 2023

Hi @David Kintzinger ,

Welcome to the community !! Small correction required in your JSON. 

Use below json, here I am copying value from Approvers field

{"update": {
"Request participants": [
{
"add": {"id":"{{issue.Approvers.accountId}}"}
}
]
}
}

David Kintzinger February 27, 2023

Thanks for your reply! 
I switched this up a little bit and used the following code:

{
"update": {
"Request participants": [
{
"add": { "id": "{{approval.approver}}" }
}
]
}
}

 This works perfectly fine and adds the approver that either approved or declined the current ticket to the list of Requested Participants.

The key seems to be to set the "id" field as you suggested instead of setting the "Name" field.
I found a different question where it was stated that using the "name" field ist deprecated in Jira cloud.


Thanks so much for your help!

Like Rilwan Ahmed likes this
3 votes
Tobias H
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.
February 27, 2023

Hi David!

I believe this is possible without using JSON.

Set the automation to trigger
When: Approval completed
Then: Edit issue field

Screenshot 2023-02-27 at 13.11.23.pngSelect Request Participant from the cogwheel drop down

Screenshot 2023-02-27 at 13.13.48.png

Press the three dots to the right of the field below the cogwheel and select Copy.

 

Change the value to copy from Appover and make sure the checkbox to "Add to existing values" is kept checked, that way it won't write over the existing request participants.

Screenshot 2023-02-27 at 13.16.18.png

(Edit: Fixed the last image, as it said request participants earlier)

David Kintzinger February 27, 2023

Thank you for your answer. I already implemented the solution that Rilwan Ahmed stated above but yours seems to do what we need as well.

Like Tobias H likes this
Edgardo Ibarra
Contributor
August 9, 2023

Hey

This really help me recently, so thank u so much! 🫶🏼

Suggest an answer

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

Atlassian Community Events