How to configure an automatic transition based on the Return code of SAP Transport Panel

As Reporter of an issue you normally want to know, when a change is ready on production. To integrate this information into a Jira status, we recommend an automatic transition based on the return code of the transports. 

Transition: READY FOR PRODUCTIONIN PRODUCTION

  • When a transport is imported on a productive system the return code is sent back to Jira. 
    • The Return code field in Jira contains the highest code of all transports related to the issue (from the update of the transport via SAP).
    • When a Return code of 0 or 4 is present in the issue the import step in SAP was successful
  • The App Jira Misc Workflow Extensions (JMWE) checks the field Return code via a scheduled job in Jira and automatically sets the issue from the status READY FOR PRODUCTION to the status IN PRODUCTION depending on the field content (see app dependencies: Requirements, Installation & Setup).

Even in the best teams, it may be the case that transports have to be reworked and these transports have to be reimported. So that an existing Return code does not trigger an automatic transition again, the Return code field is emptied before the new import step.

Transition: All → READY FOR PRODUCTION


Step-by-Step Guide

Automatic transition to In production

Add an automatic transition to In production with JMWE based on the return code in the Original transport management workflow

Further information → innovalog: Scheduled action - JMWE for Jira

StepProcedureExample
1

In Jira, navigate to Admin Menu (cog wheel) → Manage Apps → JIRA MISC WORKFLOW EXTENSIONS → Scheduled actions 

You have to install JIRA MISC WORKFLOW on your Jira


2

Add an element via click on Add scheduled action.

3

Define general setting and target issues for this action.

FieldExampleDescription

Action name

Transition an issue, when an import step was successfulWe recommend to define description from a business point of view. 

Description

Transition of an issue after the highest return code of the issue is 0 or 4.The Transition shall trigger, when a Return code of 0 or 4 is present in the issue. 

User

Armin the AdminWe recommend to select any Admin user or create a specific Bot User to run this action.

Schedule

We recommend choosing a small interval, but the action can also run daily depending on your needs.

4

Define the target issues

FieldExampleDescription
JQL Expressionproject = SAPT AND status = "Ready for production"Define the relevant issues, which shall be checked on the scheduled basis. 
Max issues1000Enter the maximum number of issues that the JQL search can return. The max. limit is 1000.

5

Add an action via a post function via click on Add post function


6Select Transition current issue (JMWE app) and click on Add.
7

Select the option Trigger one of the following transitions and click on the Transition Picker in the following configuration.



8

Select the Original transport management workflow. Select Import to production as the transition (transition from READY FOR PRODUCTION to IN PRODUCTION).

Click on Use Transition Name to add the transition. 

9

Scroll down to the area Conditional execution and check Only if condition is true.



10

Insert the following Groovy Script in the associated field.

returncode = issue.get("Return code");
if(returncode == "0" || returncode == "4") {
  return true;
}
return false;

Save the settings via click on Add

11Save your setting via click on Save

Empty Return code field 

Empty the Return code field in a transition to Ready for production with JMWE in the Original transport management workflow

StepProcedureExample
1In Jira, navigate to Admin Menu (cog wheel) → Issues → Workflows → SAP Transport Panel: Original transport management workflow → Edit → Diagram View

2

Your are now in the tab Post Functions. Click on Add post function.

Select the function Clear field(s) (JMWE app) → click on Add

3Select the field Return code and click on Add

4The final sequence should look like the example on the right.