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

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

REST API - numerous calls now throwing an error

Looks like a change was made to remove the "name" attribute from my projects and issues - the only field available (to assign an issue, for example) is now "displayName."

I"m having numerous issues, all of which seem to be related to the removal of this field - but I can't seem to use displayName to do anything, either.  I can't create / edit / or do much of anything that's user based on an issue.

I'm using assigning an issue as a touchstone here -  The 8.7.1 documentation says I should be able to do something as basic as 

{ "name": "harry" } with PUT /rest/api/2/issue/{issueIdOrKey}/assignee

but "name" doesn't work, "displayName" doesn't work - I can't find an option that's viable. 

Any suggestions? 

6 answers

1 accepted

0 votes
Answer accepted

So I got an answer back - because I opened an issue then escalated.

It's part of their change to remove userIDs and use accountIDs instead.

Why another member of their customer base has to tell you this is beyond me - it must be how they make money left and right.  It's documented, but, again, Atlassian can't be bothered to inform us they're making the change on a given day - we have to go find the info when our apps break.

Go here:

https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/

Hi,

you write "By 29 April 2019" but why has "name" gone in the "issue" api last week and not one year ago?

(see https://community.atlassian.com/t5/Jira-questions/JIRA-REST-API-missing-parameters/qaq-p/1302944 )?

I've managed to shift some of my code to accountId successfully, so that part works.  I can post some JSON if that helps anybody.

Please do, we aren't getting accountId. We get nothing related to assignee's, reporter etc.

So I'm using powershell, but this should be easy enough.  Their docs say that the initial search for the accountId is one "where the value can be an email address, display name, or any other user attribute."

I'd use email address, because I've learned the search does not always return a single accountId, even if I use what I perceive as a unique username.

$restapiuri = "$baseurl/rest/api/latest/user/search?query=$name"
$jsonresponse = invoke-restmethod -uri ($restapiuri) -Headers $httpheader -method get -contenttype "application/json"
if ($jsonresponse -ne "") {return ($jsonresponse.accountId)}

gets me an accountId.

Then to set the assignee:

$body = "{`"accountId`":`"$assigneeId`"}"
$restapiuri = "$baseurl/rest/api/latest/issue/$Issue/assignee"+ "?notifyUsers=false"
$jsonresponse = invoke-restmethod -uri ($restapiuri) -Headers $httpheader -method put -contenttype "application/json" -body $body

Works for me.

and the JSON for $body in the assignee setting routine:

{"accountId":"55xxxxx:69bb27f2-4xce-4x9b-9x87-xxxxxxxxx"}  where the x's are numbers that I removed.

Changing my app to use accountId instead of name worked. This affects assignee and reporter.

You can easily look up the id of a user now from inside advanced search using the JQL, it will still allow you to search by name but once you select it, the id will be revealed. 

I reached out to HelpScout because their JIRA integration is also affected by this. 

Why this wasn't officially announced like the API Tokens for basic auth, is beyond me but glad this community exists so we can help each other!

But we aren't getting accountId either. assignee, reporter etc. are all null.

Also experiencing issues with the API while no recent changes has been made to our codebase, just can't create tasks anymore. I can confirm everything was operational yesterday. 

I'm experiencing the issue as well, starting some time early-mid afternoon CT yesterday.  If I include "assignee":{"name":"some-user"} in the REST API body, I'm getting a 400 with "Issues must be assigned" in the "errors" object in the response body.  Our code that calls Atlassian's REST API has not been touched in a while, which makes me think something is broken on their end.  FWIW removing the assignee from the REST API call results in a successful 201 response.

I'm getting a similar error via the Java REST client API. It was working until a few days ago. Now we get an exception when we try to create a new issue: 

Caused by: org.codehaus.jettison.json.JSONException: JSONObject["name"] not found.
at org.codehaus.jettison.json.JSONObject.get(JSONObject.java:360) ~[4851c14d-6b7cb8c3:1.1]
at org.codehaus.jettison.json.JSONObject.getString(JSONObject.java:487) ~[4851c14d-6b7cb8c3:1.1]
at com.atlassian.jira.rest.client.internal.json.JsonParseUtil.parseBasicUser(JsonParseUtil.java:192) ~[c8b6915-40a88a76:?]
at com.atlassian.jira.rest.client.internal.json.UserJsonParser.parse(UserJsonParser.java:34) ~[c8b6915-40a88a76:?]
at com.atlassian.jira.rest.client.internal.json.UserJsonParser.parse(UserJsonParser.java:31) ~[c8b6915-40a88a76:?]
at com.atlassian.jira.rest.client.internal.json.IssueJsonParser.getOptionalNestedField(IssueJsonParser.java:300) ~[c8b6915-40a88a76:?]
at com.atlassian.jira.rest.client.internal.json.IssueJsonParser.parse(IssueJsonParser.java:235) ~[c8b6915-40a88a76:?]
at com.atlassian.jira.rest.client.internal.json.IssueJsonParser.parse(IssueJsonParser.java:88) ~[c8b6915-40a88a76:?]
at

Suggest an answer

Log in or Sign up to
This widget could not be displayed.
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