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

append multiple request participants through Automation without clearing the field

Remedy Partners November 21, 2017

I can do this for a single user with:

{
    "update": {
        "customfield_13200": [
            {
                "add": {"name": "username"}
            }       
        ]
    }
}

and this works for multiple users if I want to clear the field first:

 

{
    "fields": {
        "customfield_13200" : [ { "name":"username1" }, { "name":"username2" }, { "name":"username3" }]
    }
}

but fails when trying to update (append) with multiple users:

{
    "update": {
        "customfield_13200": [
            {
                "add": [ { "name":"username1" }, { "name":"username2" }, { "name":"username3" }]
            }       
        ]
    }
}

 

2 answers

1 vote
JasbrisMcCaw October 27, 2020

I use this method on JIRA DC with the Automation for JIRA add-on. The format I had to use was:

{
"update": {
"customfield_11808": [
{ "add": { "name":"ABC123" } },
{ "add": { "name":"DEF456" } }
]
}
}

 

This worked for me. I know this is an old post, but hopefully this helps someone.

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 21, 2017

Is there a reason you are trying to use the issue edit endpoint in REST to do this?

Jira Service Desk has some addition APIs that are intended to handle just this specific function of adding requested participants.   I would recommend trying to use those endpoints in REST instead: https://docs.atlassian.com/jira-servicedesk/REST/3.9.0/#servicedeskapi/request/{issueIdOrKey}/participant

The json format is a bit different than what you have above.  The example they list is

{
    "usernames": [
        "josh",
        "john",
        "joe"
    ]
}
Tim Nelson April 6, 2021

Because they're using Automation for Jira, and it doesn't appear to be able to use that endpoint. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events