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

Want to update multi valued fields like Tags through Patch Request API call

Shuchi Shah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 30, 2024

I want to update tag field in capability with the patch request 

 

I gave the request body as:

[
{
"path": "/tags",
"op": "add",
"value": "abc"

},
{
"path": "/tags",
"op": "add",
"value": "pqr"

},

]

 

however this is not adding the values abc and pqr,

it is replacing the values with the last operation that is pqr

the value of tags = "pqr"

2 answers

0 votes
Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2024

@Shuchi Shah The Tag field is just a String (not an Array) so you have to first get the current value and then append the additional tag strings.

0 votes
Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2024

The syntax for adding to an array is shown in image 1 and results in image 2.  Note the "/-" at the end of the "path". Image 3 seems to be indicating that it is broken for "Tags".  I have a script that I have run in the past that uses that syntax to add to Tags, so I am fairly certain it worked in the past.

I'll check if this is a known bug and report back.

 

Screenshot 2024-05-01 at 8.41.02 AM.png

image 1

 

Screenshot 2024-05-01 at 8.40.38 AM.png

image 2

 

 

Screenshot 2024-05-01 at 8.43.19 AM.png

image 3

Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2024

I did not see this listed as a know issue, so I created the following support request: ALIGNSP-24303

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events