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

Delete participant rest api jira cloud

Hello everyone.

I'm trying to delete a user from request participants via res api.

i found this:

and is the same as the add participant but changing post to delete.

My code is:

def requestParticipantsSD = "customfield_10023"

def userSD = issueToUpdate.fields[requestParticipantsSD].accountId

userSD.each { user ->

def bodyData = '{"accountIds": ["'+user+'"]}';

def resp = delete("rest/servicedeskapi/request/"+issuekey+"/participant")
.header("Accept", "application/json")
.header("Content-Type", "application/json")

and is returning me an error 500: No content to map due to end-of-input


im doing the same but changing delete to post, and returns 200 and the participant is added.

Any ideas?

Thanks you!

1 answer

0 votes
Dario B Atlassian Team Oct 25, 2019

Hi @Josep_Maria_Cao ,

If my understanding is correct you are able to add a request participant using the JSD REST API endpoint /rest/servicedeskapi/request/{issueIdOrKey}/participant but you cannot remove them.

If my understanding is correct, then you might be facing the below bug:

Can you kindly review it and check if that's the same issue you are facing? 

If it is the same issue, you may want to vote and watch the above bug ticket so that you will be notified in case of any progress.

If this is a different issue then I would advise to check if you are able to run the same request using Curl. This way you can determine whether the issue is with your code or with the endpoint itself.

In case the Curl request will fail can please add the -D- flag to the command so that it will print the whole response header and paste the output of the command in your reply (making sure to remove all the sensitive data from there).




thanks for your time, but my question is, if my code is working with POST method to add a new user in request participant and your info to do this is change POST to DELETE, and is not working, why do you think my code is wrong?

This is working:

def resp = post("rest/servicedeskapi/request/"+issuekey+"/participant")
.header("Accept", "application/json")
.header("Content-Type", "application/json")

the full error is:

2019-10-28 13:42:21.306 WARN - DELETE request to rest/servicedeskapi/request/HD-65/participant returned an error code: status: 500 - Server Error (530) (proxy status: 530)
body: {"status-code":500,"stack-trace":" No content to map to Object due to end of input\n\tat\n\tat\n\tat\n\tat org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(\n\tat com.sun.jersey.spi.container.ContainerRequest.getEntity(\n\tat com.sun.jersey.spi.container.AdaptingContainerRequest.getEntity(\n\tat com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$EntityInjectable.getValue(\n\tat com.sun.jersey.server.impl.inject.InjectableValuesProvider.getInjectableValues(\n\tat$EntityParamInInvoker.getParams(\n\tat$ResponseOutInvoker._dispatch(\n\tat com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(\n\tat com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(\n\tat com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(\n\tat com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(\n\tat com.sun.jersey.server.impl.applicat

 Thank you

Dario B Atlassian Team Oct 29, 2019

Hello @Josep_Maria_Cao ,

At this current point in time I don't have enough information to be in the position to make the assumption that your code might be wrong.  Therefore, I am asking you to test some things in order to try narrow down this issue.

I have already tried to reproduce the issue on my side using Curl and everything works fine for me. Please see the output below:

curl -D- -u <USERNAME>:<PASSWORD> -H "Accept: application/json" -H "Content-Type: application/json" -d  '{"accountIds": ["qm:c170xxxxxxxxxxxxxxxxxxxx"]}' -X DELETE https://<SITE>

HTTP/2 200 
server: AtlassianProxy/
vary: Accept-Encoding



So, since I cannot reproduce the issue, I need you to verify:

  1. If you are facing the bug tracked as [JSDCLOUD-5033] Unable to remove request participant via REST API when reporter is on the list
  2. What happens if you try to run the same request using Curl as I did above. I need to see the beginning of the header as well as the error message returned by Jira Cloud
  3. (added) Looking at the provided stacktrace I can see a proxy status: 530 error returned. Do you actually use a company proxy or similar? Can you try to run the same code from a machine that do not use a proxy or from a different network and let me know if this works?




Suggest an answer

Log in or Sign up to answer

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