Programmatically progressing on workflows

Another operation that we perform normally on workflows is to programmatically transition the issues through its workflow statuses. Let us have a look at how to do this using the JIRA API.

How to do it...

Transitioning issues is done using the IssueService (http://docs.atlassian.com/jira/latest/com/atlassian/jira/bc/issue/IssueService.html). Here is how you do it:

  1. Get the IssueService object, either by injecting it in the constructor or as follows:
            IssueService issueService = ComponentAccessor.getIssueService();
  2. Find out the action ID for the action to be executed. You can either get it by looking at the workflows (that is, the number within brackets alongside the transition name) if you know it is ...

Get JIRA Development Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.