Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Preparing for JIRA ITSM Integration with FlexDeploy

...

You need to create an API token for use in FlexDeploy. The API token will be encoded using base64 before used in the request to get change request or create any new request

  1. Log into Jira ITSM

...

  1. Go to Account Settings

  2. Click Security

  3. Click Create and Manage Tokens

  4. Here, you can create a new API token, and use this token for your Jira ITSM instance in FlexDeploy.

...

Permissions

The user configured in FlexDeploy must have permission to access and create tickets. You can view and update permissions for your Jira ITSM project from Project Settings → Permissions.

...

Jira ITSM Instance Properties

Property Name

Property Code

TypeRequired

Description

Jira URLString

FDJIRAITSM_URL

Yes

Jira URL (http://myjira.atlassian.net)

Jira UserString

FDJIRAITSM_USER_NAME

Yes

Jira User Name

Jira API TokenString

FDJIRAITSM_API_TOKEN

Yes

API token for Jira

Note that encrypted properties are stored in Credential Store (Local or External) and can be configured using Edit button next to credential name drop down. Alternatively, you can reuse single credential for multiple properties also, in which case you should name that credential appropriately.

Jira Ticket URL PatternString

FDJIRAITSM_TICKET_URL_PATTERN

Yes

The URL to open Jira ITSM and navigate to the change ticket associated to the project workflow execution

  • Default URL pattern is /browse/{JIRA_CHANGE_NUMBER}

  • The URL should include {JIRA_CHANGE_NUMBER} string as the execution system will replace it with the actual change number during execution

Jira GET Rest API PatternString

FDJIRAITSM_TICKET_REST_GET_PATTERN

Yes

Jira Rest API URL Pattern for a GET request

  • Default URL is /rest/api/2/issue/{JIRA_CHANGE_NUMBER}

  • If needed, you can change and use your custom GET URL pattern for Jira ITSM REST endpoint.  The URL should include {JIRA_CHANGE_NUMBER} string as the execution system will replace it with the actual change number during execution.

Jira POST Rest API PatternString

FDJIRAITSM_TICKET_REST_POST_PATTERN

Yes

Jira Rest API URL pattern for creating a change ticket

  • Default URL pattern is /rest/api/2/issue

  • If needed, you can change and use your custom URL to create a new change using the POST operation

Approved Check ScriptString

FDJIRAITSM_APPROVED_SCRIPT

No

A Groovy expressions which determines whether a task for the change ticket is approved or not.  The expression must return a boolean, and has access to the following variables:

  • TICKET - an object with fields (JSON) contained in the change ticket, as returned by the Jira ITSM REST API.  Fields are referenced as TICKET.<field name>.<sub-field name>

  • FD_ENVIRONMENT_CODE - The environment for a particular deployment request or associated pipeline stage.

Info

If the Approved Check Script is left blank, the default implementation checks the status of the ticket to determine if it's approved. Statuses of awaiting implementation, implementing, and completed are considered approved and return true.

Default Check
Code Block
languagegroovy
TICKET.fields.status.name == 'Awaiting implementation' || TICKET.fields.status.name == 'Implementing' || TICKET.fields.status.name == 'Completed'
Example that checks custom field value specific to target environment
Code Block
languagegroovy
(TICKET.fields.customfield_10107.status == 'UATApproved' && FD_ENVIRONMENT_CODE='UAT') || (TICKET.fields.customfield_10107.status == 'PRODApproved' && FD_ENVIRONMENT_CODE='PROD')
Info

If you want to see values that can be used, enable FINEST log level for flexagon.fd.model.integration.cms.CMSScript using Admin Operations.

Rejected Check ScriptString

FDJIRAITSM_REJECTED_SCRIPT

No

A Groovy expressions which determines whether a task for a change ticket is rejected or not.  The expression must return a boolean, and as has access to the following variables:

  • TICKET - an object with fields (JSON) contained in the change ticket, as returned by the Jira ITSM REST API.  Fields are referenced as TICKET.<field name>.<sub-field name>

  • FD_ENVIRONMENT_CODE - The environment for a particular deployment request or associated pipeline stage.

Info

If the Rejected Check Script is left blank, the default implementation checks the status of the ticket to determine if it's rejected. Statuses of declined, canceled, and failed are considered rejected and return true.

Additional Info ScriptString

FDJIRAITSM_ADDITIONAL_INFO_SCRIPT

No

A Groovy expression which determines additional information to add to an external approval when it is approved or rejected.  The expression must return a Map<String, String> and have an entry with the key of "notes" for the value to get added to external approval as a task note. Script has access to the following variables:

  • TICKET - an object with fields (JSON) contained in the change ticket, as returned by the ServiceNow REST API.  Fields are referenced as TICKET.<field name>.<sub-field name>

  • FD_ENVIRONMENT_CODE - The environment for a particular deployment request or associated pipeline stage.

Don't pollBoolean

FDJIRAITSM_DONT_POLL

No

Disable automatic polling (every minute) of Jira tickets for status changes. The default value is false, which means polling will occur.  Only check this box if you are using the FlexDeploy REST API to communicate ticket approval/rejection.

...