Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I'm trying to update a field in an issue over REST API. But I always get "Method failed" Error

nithishgunda February 13, 2018

I'm trying to update a field in an issue over REST API from ServiceNow. But I always get "Method failed" Error when I drop a Put request. POST requests work. Anybody know what I am doing wrong?

4 answers

0 votes
Mahesh war December 5, 2018

I am also getting the same issue, what type of permissions do I need to check. Please help me with this 

Nic Brough -Adaptavist-
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.
December 5, 2018

As mentioned above - to edit an issue, you need edit permission.

0 votes
nithishgunda February 14, 2018

The user has not the permission to update this issue.

kumar_ankush_in_bosch_com August 21, 2018

Hello Nithish,

Exactly, what permission is required to update issue in JIRA through rest api

Nic Brough -Adaptavist-
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.
August 21, 2018

The user needs "Edit" rights to update it.

kumar_ankush_in_bosch_com August 21, 2018

ok, Thank you for quick reply

0 votes
nithishgunda February 14, 2018

I tried your suggestion, still, I'm getting the same error. I will check with Jira team that fields are on the edit screen or not.

Thanks

nithishgunda February 14, 2018

Jira team told that all fields are available on the edit screen. Is there anything like user permission to update the issue.

nithishgunda February 14, 2018

Thanks, Thomas,

It worked now. The issue is with permissions. The user in Jira has no permission to update.

Thanks for your help.

0 votes
Thomas Deiler
Community Champion
February 13, 2018

Can you please post the method for examination? Cloud or Server?

nithishgunda February 13, 2018

Hi Thomas,

Here is the error message and there are some more custom fields. This works when I create an issue in Jira.

{"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate screen, or unknown."

It is Server.

Thomas Deiler
Community Champion
February 13, 2018

Thanks for the JSON response. Can you please post the request?

nithishgunda February 13, 2018

summary":"JIRA00"

Thomas Deiler
Community Champion
February 13, 2018

Thanks for the JSON payload data. Which one from the reference did you use?

nithishgunda February 13, 2018

PUT /rest/api/2/issue/{issueKey}

Thomas Deiler
Community Champion
February 13, 2018

Dear @nithishgunda,

hang on - I'll check.

Thomas

Thomas Deiler
Community Champion
February 13, 2018

Dear @nithishgunda,

first, the POST with this API call is not allowed. Use GET for read issue, PUT for update issue and DELETE to remove. You can do a POST /rest/api/2/issue to create a news issue.

I executed the command with your JSON payload. I had to modify it to fit my custom field:

{"fields":{"customfield_10100":"some value","description":"some text","priority":{"id":"4"},"summary":"new summary"}}

It worked for me perfect. While adding an unknown custom field id, I got the error message that you posted.

This message means, either the custom field id is unknown or the custom field is not set in the screen in Jira, that is used when editing the issue.

Over the API you can only edit fields, that are also visible to the same user in the UI.

My advice, make that upper call only with one of the custom fields to figure out which one causes the problem.

So long

Thomas

nithishgunda February 13, 2018

Thanks, Thomas,

I used different API and successfully created an issue in Jira from ServiceNow. Now I need to update that issue by using PUT while doing that I'm getting an error saying that fields are not on the screen but the fields are on the screen.

Thomas Deiler
Community Champion
February 14, 2018

Dear @nithishgunda,

I completely got you - otherwise I wouldn't be able to write that upper detailed reply.

For sure there is somewhere an error on your side.

  • Are you sure, the field is on the 'edit screen' and not only on the 'views screen'?
  • Have you tried my suggestion to update for test purpose field by field?

So long

Thomas

Thomas Deiler
Community Champion
February 14, 2018

Dear @nithishgunda,

best you check your API calls with the same user you access the UI. The permission to modify fields/custom fields are:

  • Browse Project
  • Edit Issues

So long

Thomas

Thomas Deiler
Community Champion
February 14, 2018

Dear @nithishgunda,

thanks for this feed-back. You discovered a potential improvement of the API. The error message was misleading - it would be better to say "The user has not the permission to update this issue". I will care about that.

If you find this conversation helpful for others, please mark my response as "Accepted".

Many Thanks

Thomas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events