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

how to change the issue status using java code

KiranK May 27, 2015

I have requirement to change the issue status from indefination to Ready for Developement for one of the business use case.

I have written the custom plugin but not able to find the API to update the issue status.

Here is the code:

MutableIssue mutableIssue = issueManager.getIssueByCurrentKey(issueParent.getKey());
mutableIssue.setStatusObject(cacheStatus);
//mutableIssue.setStatusId("10064");
issueManager.updateIssue(user, mutableIssue, EventDispatchOption.DO_NOT_DISPATCH, false);
setReindex(mutableIssue);
issueParent.store();

 

Please help me if any one aware of.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
KiranK May 27, 2015

Thanks lot. I already use the workflowutils but forgot to use the method progress()

Ramesh Lakshmanasamy July 21, 2018

@KiranK Please can you explain how to update Status using java API?

I have Status name and Status ID.Then how to get Transition id using these.i am using "workflowTransitionUtil" to update Transition.but before i need Transition Id to update Status

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 27, 2015

No.  You cannot just "set" the status of an issue.  It's NOT a field, it's an indicator of where an issue is in the workflow.

You must use workflow transitions to move the issue through the workflow.  Take your current issue, look at its status, work out which transition gets you to the target status and move it on.

Use issueservice or workflowutils to push the transition

Viti June 18, 2019

how do you build  the class issueManager ?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 18, 2019

I'm not sure what this has to do with my answer here.  Plus it's from 4 years ago?

TAGS
AUG Leaders

Atlassian Community Events