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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

API is not able to modify value for issue related custom field Edited

I have a issue created. The issue has a custom property "Ignore for Release" the value is checkbox. 

Now I want to check and uncheck the value for this property using REST API. 

What I tried:

1- Method GET. I have retrieved all the fields using https://domain.com/rest/api/2/field/ 

2- Method PUT. https://domain.com/rest/api/2/issue/{issueId}/properties/{fieldId}

Body:

[{ "id" : 12840}]

API returns 201 but still I don't see any changes for my issue. The check box should be checked when I hit API mentioned in bullet 2. 

Not sure what I am doing wrong :(

1 answer

1 accepted

0 votes
Answer accepted
Warren Community Leader Nov 30, 2020

Hi @s sushil Tade 

I don't update checkboxes, but to update the Description field, I use a PUT method with the following call

/rest/api/2/issue/ABC-123

and pass in JSON like this

{
  "update":

  {
    "description": [
    {
      "set": "new text goes here"
    } ]
  }
}
 

Thanks, Description part will work but I have concern with added custom field. Do you have any idea how to update value for checkbox?

Warren Community Leader Nov 30, 2020

Hi @s sushil Tade 

Yes you can do customfields as well. I've managed to set a checkbox on my system passing in this JSON

{
  "update":

  {
    "customfield_14572":

    [
      {
        "set":

        [
          {
            "value": "Yes"
          }
        ]
      }
    ]
  }
}

@Warren It's working. You made my day!. Thank you. Also I have question how to reset the value back (how to uncheck?).  

Please send me the link from did you find above payload. I am able to find the field Id. but I was using this API https://domain.com/rest/api/2/issue/{issueId}/properties/{fieldId}

Warren Community Leader Nov 30, 2020

Hi @s sushil Tade 

I'm glad it worked for you as well.

To unset it, replace "Yes"  with null - note that null doesn't use quote marks.

To find the field ID, go to Settings, Issues, Custom Fields, then on the custom field you want, click the 3 dots on the right of that row, select Edit and look at the URL

 

Screenshot_1.jpg

Thanks!. You are Awesome. I never thought of null

Also thanks for helping about how to find field ID. 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you