How to remove an issue from sprint using API?

Mike Daniels November 29, 2021

I've tried four ways to remove an issue from a sprint and none of them will do it. They all return an empty response (which the documentation indicates is "success"). But the issue remains in the sprint. What is the correct way to do it?

1. com.atlassian.jira:jira-rest-java-client-app:5.2.2

final IssueInput request = new IssueInputBuilder()
.setFieldValue(FIELD_SPRINT, null)
.build();

final IssueRestClient issues = client.getIssueClient();
issues.updateIssue(issue.getKey(), request).claim();

2. PUT directly to the REST endpoint

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

body:
{
"fields": {
"customfield_471": null
}
}

3. POST directly to another endpoint I found mentioned elsewhere

/rest/agile/1.0/backlog/issue

body:
{
"issues": [
"PRJ-27"
]
}

4. PUT directly to yet another endpoint I found mentioned elsewhere

/rest/greenhopper/1.0/sprint/rank

body:
{
"idOrKeys": [
"PRJ-27"
],
"customFieldId": "customfield_471",
"addToBacklog": "true"
}

 

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2021

@Mike Daniels 

Are you working with issues in a Company Managed project or a Team Managed project?

Mike Daniels November 29, 2021

This one is Company Managed.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2021

Can you confirm that the identity used to run the API can successfully remove an issue from a sprint via the UI?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2021

Looking at what you specified for the third method you tried (agile API 1.0) I notice that you are missing the closing double-quote between issues and the following colon. Is that a paste error here in your post, or is that an error in the code you are actually using?

Mike Daniels November 30, 2021

Sorry, the missing double-quote was an error in this post (I've corrected it). In the actual code we use an ObjectMapper to serialize / deserialize JSON.

The identity used by the API should be able to remove an issue from a sprint in the UI, it is an admin. But I will verify that! Thanks.

Mike Daniels November 30, 2021

Ok, just tested that. In the UI, I was able to add / remove an issue from the sprint while logged in as the identity used by the API.

Mike Daniels December 22, 2021

@Trudy Claspill any other ideas? I appreciate the help / suggestions!

Suggest an answer

Log in or Sign up to answer