Page tree

You can integrate BMC Release Process Management (RPM) with JIRA over SSL. BMC provides a default set of automation scripts that you can import from the library and start using directly. You can also modify the existing scripts or create your own scripts. This topic provides information about the following:

Configuring JIRA integration

Before you start using automation scripts, you must first create an integration server to connect JIRA and RPM.

  1. To create an integration server, go to System > Integrations.
  2. In the right pane, click Create new Integration.
  3. From the Server Type list, select JIRA.
  4. In the Server Name box, enter a unique name to identify the server for JIRA. For example, JPS JIRA.
  5. (Optional) In the Ip box, enter JIRA IP.
  6. In the Server URL box, specify the fully qualified URL to JIRA.
  7. (Optional) In the Port box, enter the port used for JIRA.
  8. In the Username  box, enter JIRA user name.
  9. In the Password  box, enter JIRA user password.

    Note

     All actions in JIRA are logged under the credentials specified when configuring the integration.

  10. In the Details box, to use JIRA credentials for connection from RPM, enter auth_type: :basic.
     

  11. Click Add Server.

Back to top

Importing scripts

After you configure an integration server, import all automation scripts available for JIRA by navigating to Environment > Automation, and then clicking Import scripts from Library on the right pane.

After completing the configurations, you can create a request, add steps to the request, and use the automation scripts available for JIRA to perform your tasks.

Data retriever scripts for JIRA integration

Script nameDescription
jira_issue_transitionsRetrieves the statuses to which an issue can be transitioned. This data retriever script is used in the progress_workflow_for_issue_jira_rest local Ruby script.
jira_issue_typesRetrieves all possible issue types that you can create in JIRA. This data retriever script is used in the add_request_issue_jira_rest local Ruby script.

jira_resource_tickets

Based on the specified JQL filter, retrieves issues from JIRA that can be assigned to a plan. For more information about how and where to use this script, see Associating JIRA issues with a plan.

Local Ruby scripts for JIRA integration

Script nameDescription

add_request_issue_jira_rest

Creates an issue in JIRA. This script uses the jira_issue_types data retriever script that extracts all possible issue types that you can create in your JIRA.

add_comment_to_issue_jira_rest

Adds a comment to the specified issue.
get_issue_status_jira_restReturns the current status of an issue.
progress_workflow_for_issue_jira_restTransitions an issue into one of the possible statuses that you can select from the list. This script uses the jira_issue_transitions data retriever script that extracts all possible statuses to which the issue can be transitioned.

set_issue_property_jira_rest

Updates attributes of the specified issue, such as summary or description.

Back to top

Working with JIRA integration scripts

You can use automation scripts in the steps of a request to perform the different actions in JIRA like creating an issue, adding a comment, getting issue status or changing it, and editing attributes of an issue.

Creating an issue

To create an issue in Jira, open the required request and create a step with the following automation:

  1. In the Name box, enter a step name.

  2. From the Type list, select either package or component. The data provided in this box is not used for JIRA integration.

  3. From the Owner list, select a user who will be responsible for the step.

  4. From the Component list, select any component. The data provided in this box is not used for JIRA integration but only to enable automation.

  5. On the Automation tab, from the Step Action list, select Jira.
  6. From the Task list, select Add request issue jira rest.
  7. In the Automation timeout box, enter timeout in seconds if needed.
  8. In the Project key box, enter the project key in JIRA.
  9. From the Issue type list, select the required issue type.
  10. In the Summary box, enter a short summary of an issue.
  11. In the Description box, enter issue description.
  12. In the Custom attributes box, specify any custom boxes that are required in the created issue. For more information, see Specifying custom attributes.

  13. Click Add Step & Continue or Add step & Close.

(click the image to expand)

After you run this automation step, you can go to the Notes tab of the corresponding step and click a link to the created issue.

(click the image to expand)

Back to top

Adding a comment to an issue

To add a comment to an issue in JIRA, open the required request and create a step with the following automation:

  1. In the Name box, enter a step name.

  2. From the Type list, select either package or component. The data provided in this box is not used for JIRA integration.

  3. From the Owner list, select a user who will be responsible for the step.

  4. From the Component list, select any component. The data provided in this box is not used for JIRA integration but only to enable automation.

  5. On the Automation tab, from the Step Action list, select Jira.
  6. From the Task list, select Add comment to issue jira rest.
  7. In the Automation timeout box, enter timeout in seconds if needed.
  8. In the Issue key box, specify ID of an issue to which you want to add a comment.
  9. In the Comment body box, enter your comment to the issue.
  10. Click Add Step & Continue or Add step & Close.
    (click the image to expand)

After you run this automation step, you can go to the Notes tab of the corresponding step and click a link to the created issue with the added comment.

(click the image to expand)

Back to top

Getting issue status

To retrieve issue status from JIRA, create a step with the following automation:

  1. In the Name box, enter a step name.

  2. From the Type list, select either package or component. The data provided in this box is not used for JIRA integration.

  3. From the Owner list, select a user who will be responsible for the step.

  4. From the Component list, select any component. The data provided in this box is not used for JIRA integration but only to enable automation.

  5. On the Automation tab, from the Step Action list, select Jira.
  6. From the Task list, select Get issue status jita rest.
  7. In the Automation timeout box, enter timeout in seconds if needed.
  8. In the Issue key box, specify JIRA issue ID for which you want to retrieve the status.
  9. Click Add Step & Continue or Add step & Close.
    (click the image to expand)

After you run this automation step, you can go to the Notes tab of the corresponding step to view the issue status.

(click the image to expand)

Back to top

Changing issue status

To change issue status in JIRA, create a step with the following automation:

  1. In the Name box, enter a step name.

  2. From the Type list, select either package or component. The data provided in this box is not used for JIRA integration.

  3. From the Owner list, select a user who will be responsible for the step.

  4. From the Component list, select any component. The data provided in this box is not used for JIRA integration but only to enable automation.

  5. On the Automation tab, from the Step Action list, select Jira.
  6. From the Task list, select Progress workflow for issue jira rest.
  7. In the Automation timeout box, enter timeout in seconds if needed.
  8. In the Issue key box, specify JIRA issue ID status of which you want to change.
  9. From the Workflow transition list, select the required status.
  10. Click Add Step & Continue or Add step & Close.
    (click the image to expand)

After you run this automation step, you can go to the Notes tab of the corresponding step to view the updated issue status.

(click the image to expand)

Back to top

Editing an issue

Using RPM, you can update text inputs like summary or description. To edit an issue attribute in JIRA, create a step with the following automation:

  1. In the Name box, enter a step name.

  2. From the Type list, select either package or component. The data provided in this box is not used for JIRA integration.

  3. From the Owner list, select a user who will be responsible for the step.

  4. From the Component list, select any component. The data provided in this box is not used for JIRA integration but only to enable automation.

  5. On the Automation tab, from the Step Action list, select Jira.
  6. From the Task list, select Set issue property jira rest.
  7. In the Automation timeout box, enter timeout in seconds if needed.
  8. In the Issue key box, specify JIRA issue ID which you want to update.
  9. In the Issue field name box, enter the HTML issue attribute name that you want to edit.

    Tip

    Use Developer Tools of your browser to find out the HTML issue attribute name.

    For example, the Description HTML attribute name is description:

  10. Click Add Step & Continue or Add step & Close.
    (click the image to expand)

Back to top

Associating JIRA issues with a plan

You can use the jira_resource_tickets data retriever script to extract and associate the required JIRA tickets (issues) to a plan in RPM.

Note

For this script to work, do the following:

  1. Go to Environment > Automation, and then open the JIRA resouce tickets script.
  2. At the bottom of the Editing script section, change the value of Maps to from None to Ticket.
  3. Click Update script.
  1. Ensure that JIRA integration server is configured.
  2. Open the required plan, and then on the Tickets tab, click the External Ticket Filters link.
  3. From the Select Server/Filter lists, select the JIRA integration server, and then select the JIRA resource tickets script.
  4. In the Jql query box, enter the filter conditions to retrieve the required issues from JIRA, and then click Run Filter Query.
  5. In the issues table that is generated after you run the query, select the issues that you want to associate with the plan, and then click Assign Selected Tickets to Plan.
    (click the image to expand)

    For more information about working with tickets in RPM, see Managing tickets.

Back to top

Specifying custom attributes

When creating an issue, you can populate custom attributes in JIRA by referring to the HTML elements and their values on the JIRA page.

To set a value for any attribute in JIRA, use the following format:

  • For a field with available multiple options (for example, Fix Versions, Affected Versions, or Labels): {customFieldID1: [{id: '15600', id: '34343'}]}
  • For a field where you can select only one option (for example, Source or Severity): {customFieldID2: {id: 'valueID1'}, customFieldID3: {id: 'valueID2'}}
  • For a filed where you can type a value (for example, Environment): {customFieldID4: {'Oracle DB'}

where customFieldID# are custom fields in your JIRA and valueID# are IDs of the possible values for the custom fields.

For example, you want to specify Severity of an issue that is a custom attribute:

  1. In JIRA, click Create, and then press F12 to inspect elements of the dialog box that opens.
  2. Using the inspect element function, determine IDs for the required attribute and its value.
    The following image shows that ID for Severity is customfield_10001 and ID for the Medium value is 12003.
  3. When creating a bug using the add_request_issue_jira_rest script, in the Custom attributes box, enter {customfield_10001: {id: '12003'}.

Back to top