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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

update issue status in java



I have created a Java tool that creates a Jira operational task for a parent issue. i want to set the status of operational tasks with using RestAPI directly of "Done". but i could not find a correct way or method to do it!

maybe someone have a suggestion for me?


4 answers

2 accepted

0 votes
Answer accepted

You should issue a REST call to transition the issue from one state to another.  See

0 votes
Answer accepted
Joe Pitt Community Leader Apr 08, 2020

Done requires two things whether you do it in the UI or with an API; 1. the resolution field to be set along and 2. the status must be in the filter requirement for done.  You need to find out what the status requirements are for done and set the resolution field

I got this problem too. Then I google a lot, did not find any useable solution. So I read the sdk code, find out that it is pretty simple.

please make sure you use the same version of Jira Java SDK with mine:


* update jira issue status
* status: like "Done"
public void updateIssueStatus(Issue issue, String status) {
IssueRestClient client = getJiraRestClient().getIssueClient();

Iterable<Transition> transitions = client.getTransitions(issue).claim();

for(Transition t : transitions){
if(t.getName().equals(status) {
TransitionInput input = new TransitionInput(t.getId());
issueClient.transition(issue, input).claim();


// you can ignore below if you know how to get IssueRestClient and Issue

public JiraRestClient getJiraRestClient() {
AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();

JiraRestClient client = factory.createWithBasicHttpAuthentication(URI.create(JIRA_URL), JIRA_USER, JIRA_PASSWORD);

return client;

public Issue getIssue(String issueKey) {
IssueRestClient client = getJiraRestClient().getIssueClient();
return client.getIssue(issueKey).claim();


thank you @wxweven , I was looking for Status update and this is the best solution worked as magic.

Works like a charm.

Modifying a bit to @wxweven  answer:

Changing status can be tricky depending on the process your company has put in place. Status change is actually a change in the issue transition (Ex. "In Progress Dev" to "Ready for Review" to "Done"). Your company can mandate, for example, if status needs to be changed to "Done" resolution filed must be changed to "Fixed" or "Done" etc. If so, you may need to set the resolution on the go while changing the status. Here is the code with modified updateIssueStatus method:


public void updateIssueStatus(Issue issue, String status) {
IssueRestClient client = getJiraRestClient.getIssueClient();

Iterable<Transition> transitions = client.getTransitions(issue).claim();

final Collection<FieldInput> fieldInputs;
fieldInputs =
Arrays.asList(new FieldInput("resolution", ComplexIssueInputFieldValue.with(
"name", "Done")));

for(Transition t : transitions){
if(t.getName().equals(status)) {
TransitionInput input = new TransitionInput(t.getId(),fieldInputs);
client.transition(issue, input).claim();



Please note that if resolution field is not in the "edit JIRA" screen, you may get below error:


Exception in thread "main" RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={resolution=Field 'resolution' cannot be set. It is not on the appropriate screen, or unknown.}, errorMessages=[]}]}


In such scenario you may need to discuss to your JIRA admin to make resolution field visible in "edit jira" screen.


Hope this helps.. Thanks.

Hello Pandey, Can you explain how to make the resolution field visible in edit JIRA screen. My JIRA Admin says that the field is visible, but I'm still getting the same error. Please help

Suggest an answer

Log in or Sign up to answer