How can i change the status by using name?

AKASHB July 31, 2013
I have a code through which i am making Auto Transition by using ID but since its not the right way to do it, since ID may change. So i want ot perform Tranistion based on name so anyone out there can help me out. My piece of code is like. /* WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class ); //This will capture the Wokflow workflowTransitionUtil.setIssue(issue); //This will set the Issue workflowTransitionUtil.setAction(221);//This will set the Action Id workflowTransitionUtil.progress(); //This will vallidate the progress */ So here i need to do by name.

1 answer

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.
July 31, 2013

The name of a transition is even more likely to change than the ID. I'm not sure there's any mileage in using the name over the ID. Also, Atlassian have issues logged to enable translations of names, so a single transition, with one ID could end up with several different names. I know the API lets you get a name for an ID, but I don't think it's got anything for doing the reverse. I'm afraid your code might have to read the entire workflow for each transition and pull out a name, and hope it matches.

AKASHB July 31, 2013

So Nic, but its possible to make transitions right. But its just that it may end up messing.

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.
July 31, 2013

Yes, I think it's possible, but I can't see an API method to do it - you'll have to loop through all the transitions in the workflow until you find one with a matching name.

(And deal with "no transition found because the name has changed" - I'd just fail gracefully and silently, but it does mean you'll need to explain this to users)

AKASHB July 31, 2013

Thanks a lot Nic for your feedback.

AKASHB August 1, 2013

I too have tried but, there aren't any API defined to update an issue by Name.

AKASHB August 1, 2013

Any more comments on this issue from all the experts will be helpfull

Suggest an answer

Log in or Sign up to answer