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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

HowTo: Update Asset Custom Fields via REST API

Salzi
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.
Oct 24, 2023

Since this has cost me a lot of nerves over the last few days and unfortunately the documentation is silent about the required values, here is a short HowTo

To update an issue and fields of an issue, use the following REST API endpoint:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put 

Unfortunately, the documentation says nothing about the format in which elements in an Asset Custom Field should be passed.

This is what the JSON body must look like to fill an asset field. Alternatively, you can of course also use the other keywords from the documentation (“add”, “remove”, etc.):

"update": {
"customfield_XXXXX": [
{
"set": [
{
"workspaceId": "workspaceId ot the Object",
"id": "GlobalId ot the Object (workspaceId:objectId)",
"objectId": "Id of the Object"
}
]
}
]
}

The Global ID consists of the WorkspaceId and the objectId.

 Here is an example of what such a body (with values) could look like:

 

"update": {
"customfield_10217": [
{
"set": [
{
"workspaceId": "ecaa45c7-4578-420f-a2e0-cf7b0da4b5ad",
"id": "ecaa45c7-4578-420f-a2e0-cf7b0da4b5ad:1672",
"objectId": "1672"
}
]
}
]
}

 

I'm happy if the information helps a few more people 🙂

1 comment

Anmol Agrawal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 01, 2023

@Salzi This is great!!!! Thanks a lot. I will test this out and if everything is fine, we will add it our documentation and sample apps. We really appreciate this.

Like Salzi likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events