I'm writing a JIRA plugin and trying to check if a transition ID exsits in an issue's workflow.
Can someone please point me to the correct way of doing this?
A bit of clarification:
I want to check this on the fly, from inside the plugin code, for every time it runs. I know I can call the IssueService.validateTransition() method, but I don't want to do the transition yet, just check for it.
The plugin gets this ID from a config file. It should check if the ID is valid for the given issues workflow, and I don't know if there's an easy way to do that.
I can of course find the workflow, then check for all transitions if the ID matches but it seems to be a bit of an overkill if (for example) this could be done in a simple database query.
Community moderators have prevented the ability to post new answers.
If you want to validate a transitionId on an issue you can do something like the following
int transitionId = ...; // get it from your configuration long issueId = ...; // get issue id IssueInputParametersImpl params = ...; // parameters for transition ... IssueService.TransitionValidationResult transitionValidationResult = issueService.validateTransition(user, issueId, getTransitionId(actionId), params); if (transitionValidationResult.isValid()) \{ ... // go ahead and perform the transition }
Without admin access to the actual workflow the issue is using, if you go to the issue's screen look at the workflow tabs, you will see the transitions there.
Right click on the one you are trying to verify, copy the link address and paste it somewhere
example: https://dummyweb.test.com/jira/secure/WorkflowUIDispatcher.jspa?id=32910&action=5&atl_token=BQQ2-WUJU-PI09-ZTUI|55d91908933c373e23758b0b5af4c84644bf2c47|lin
The transition ID should be the number after action, in this case "5"
If you have admin access to the workflows and know the workflow being used, when you go to the text view of the workflow next to the transition there is a number Resolve Issue (5) and if you rightclick on the transition and copy the link address it will show you all the info for the transition.
https://dummyweb.demo.com/jira/secure/admin/workflows/.....&workflowName=jira&workflowStep=1&workflowTransition=5
---hope this helps.
I see, this page might help: https://developer.atlassian.com/display/JIRADEV/Database+Schema
I belive the transition is stored as Action_id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not what I meant, I want to check if a given ID is there. It looks like I wasnt clear enough, so I updated the question :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.