Forums

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

Change status with JiraRestClient

Viti June 17, 2019

Hi!!,

 

How do I change the status of an Issue?

 

I have this code:URI uri = new URI(JIRA_URL);
JiraRestClient client = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication(uri, USER,PASS);

Issue issue = null;
Promise promise = client.getIssueClient().getIssue("PPDGLB-147");
issue = (Issue) promise.claim();

 

I have the issue, but there is no the method setStatus.

Thanks

 

 

2 answers

1 accepted

2 votes
Answer accepted
Viti June 19, 2019

I found the solution. The problem was that I wanted to change the status of a issue. That option isn't possible. You can change the status when you change the transition. You should change the transition in your issue

You can look the id transitions aceppted by your issue in your address jira:

http://YOUR_HOST/jira/rest/api/latest/issue/ISSUE_KEY/transitions?expand=transitions.fields

 

URI uri = new URI("http://YOUR_HOST/jira/");
JiraRestClient client = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication(uri, USER,PASS);

Promise promise = client.getIssueClient().getIssue("MY_JIRA_KEY");
Issue issue = (Issue) promise.claim();

TransitionInput transitionInput = new TransitionInput("ID_TRANSITION");
this.client.getIssueClient().transition(issue, transitionInput);

0 votes
Viti June 18, 2019

Please, any help?

is possible the change?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events