Versions Compared

Key

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

To create a Change Management instance, select the Change Management tab, and click the  button. To edit an existing instance, click on an Instance row from the list.

Enter values for the fields as described in the table below.

...

Click the Test  button to test the connection and verify that the url, port, username, and password are correct. Click the Save button to save the changes. Optionally click the Apply button to save the changes, but remain on the current screen until the Cancel button is clicked.

ServiceNow Properties

Property

Type

Description

ServiceNow URL

String

The URL for accessing ServiceNow.

ServiceNow User Name

String

A local ServiceNow service account user with a non-expiring password. 

ServiceNow Password

String

The password for the ServiceNow User Name above.

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.

ServiceNow Request GET URLString

The URL to get the change request details as json response.   @Since 5.4.0.1

  • Default URL is /api/now/table/change_request?sysparm_query=number%3D{SN_CHANGE_NUMBER}
  • If needed, you can change and use your custom GET url for ServiceNow REST endpoint.  The URL should include {SN_CHANGE_NUMBER} string as the execution system will replace it with the actual change number during execution.
    • e.g. /api/xyz/mycompanty_servicenow_generic_api/readChangeRequest?number%3{SN_CHANGE_NUMBER}
ServiceNow Navigation Request URLString

The URL to open ServiceNow and navigate to the Change ticket associated to the project workflow execution @Since 5.4.0.3

ServiceNow Request POST URLString

The URL to create a change request.   @Since 5.4.0.3

  • Default URL is /api/now/table/change_request
  • If needed, you can change and use your custom url to create a new change using the POST operation
    • if you want to use Service Catalog, then change the url to /api/now/table/sc_request

Approved Check Script

String

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 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.
Info

If the Approved Check Script is left blank, the default implementation is to return true if the "approval" field of the ticket is set to "approved".


Code Block
languagegroovy
themeEclipse
titleSimple Example which is used by default
TICKET.approval == 'approved'


Code Block
languagegroovy
themeEclipse
titleExample that checks myfield value specific to target environment
(TICKET.myfield == 'UATApproved' && FD_ENVIRONMENT_CODE='UAT') || (TICKET.myfield == 'PRODApproved' && FD_ENVIRONMENT_CODE='PROD')


Tip

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

Following example is to check if current date time is between start_date and end_date defined on Ticket. Let's assume format for the date string returned and TimeZone as GMT.

Code Block
languagegroovy
themeEclipse
titleCheck if now is between start_date and end_date defined on ticket
linenumberstrue
import java.util.Date;
import java.util.TimeZone;
import flexagon.ff.common.core.utils.FlexDateTimeUtils;

if(TICKET.approval == 'approved' && TICKET.start_date != null && TICKET.end_date != null)
{
    Date start = FlexDateTimeUtils.stringToDate(TICKET.start_date, "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT"));
    Date end = FlexDateTimeUtils.stringToDate(TICKET.end_date, "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT"));
    Date now = new Date();
    if(now.after(start) && now.before(end))
    {
      return true;
    }
}
return false;


Rejected Check ScriptString

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 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.
Info

If the Rejected Check Script is left blank, the default implementation is to return true if the "approval" field of the ticket is set to "rejected".


Code Block
languagegroovy
themeEclipse
titleSimple Example which is used by default
TICKET.approval == 'rejected'


Code Block
languagegroovy
themeEclipse
titleExample that checks myfield value specific to target environment
(TICKET.myfield == 'UATRejected' && FD_ENVIRONMENT_CODE='UAT') || (TICKET.myfield == 'PRODRejected' && FD_ENVIRONMENT_CODE='PROD')


Additional Info ScriptString

@since 5.5.0.2

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.
Code Block
languagegroovy
themeEclipse
titleExample where ServiceNow Approver(s) and time of approval are added to task notes
import flexagon.ff.common.core.rest.FlexRESTClient;
import flexagon.ff.common.core.rest.FlexRESTClientResponse;
import flexagon.ff.common.core.utils.FlexJsonUtils;
import flexagon.fd.model.integration.util.ApiException;

import org.json.JSONObject;
import org.json.JSONArray;
 
import java.util.HashMap;
import java.util.Map;

import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.MediaType;


def returnMap = [:]
def approvalUrl = '{SN_URL}'
def user = '{SN_USER_NAME}'
def password = '{SN_PASSWORD}'
def resourcePath = '/api/now/table/sysapproval_approver?sysparm_display_value=all&sysparm_query=state%3Dapproved%5Edocument_id%3D' + TICKET.sys_id
      
FlexRESTClient restService = new FlexRESTClient();
FlexRESTClientResponse response = restService.url(approvalUrl).path(resourcePath).basicauth(user, password).mediatype(MediaType.APPLICATION_JSON).setValidateResponse(true).get();
      
JSONObject jsonResponse;
try
{
  jsonResponse = FlexJsonUtils.getJSON(response.getResponseString());
}
catch(Exception ex)
{
  throw new ApiException("No Json found in response. Response Code: " + response.getResponseCode() + " Error Message: " + ex.getMessage());
}

def listOfApprovers = jsonResponse.getJSONArray('result');
for (int i = 0; i < listOfApprovers.length(); i++) 
{
  def approver = listOfApprovers.get(i);
  def linkRequestUrl = approver.getJSONObject('approver').getString('link')
  restService = new FlexRESTClient();
  response = restService.url(linkRequestUrl).basicauth(user, password).mediatype(MediaType.APPLICATION_JSON).setValidateResponse(true).get();
  try
  {
    jsonResponse = FlexJsonUtils.getJSON(response.getResponseString());
    jsonResponse = jsonResponse.getJSONObject('result')
    if (returnMap.isEmpty()) 
    {
	  returnMap['notes'] = 'Approvers: ' + System.getProperty("line.separator")
    }
    else 
    {
	  returnMap['notes'] = returnMap['notes'] + System.getProperty("line.separator")
    }
    returnMap['notes'] = returnMap['notes'] + jsonResponse.getString('name') + ' (' + approver.getJSONObject('sys_updated_on').getString('display_value') + ')'
  }
  catch(Exception ex)
  {
    throw new ApiException("No Json found in response. Response Code: " + response.getResponseCode() + " Error Message: " + ex.getMessage());
  }
  
}
return returnMap


Don't PollBooleanReturns whether FlexDeploy should poll ServiceNow to check the change tickets for Approval/Rejection.  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.

...

BMC Remedyforce Properties


Property
Type
Description
Freshservice URLStringFreshservice URL (https://<your_helpdesk_domain_name>.freshservice.com)Freshservice API KeyString

API key for Freshservice

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.

Approved
Property
Type
Description
BMC Helix Remedyforce URLStringBMC Helix Remedyforce Instance URL (https://<instance_name>.salesforce.com)
BMC Helix Remedyforce User NameStringBMC Helix User Name
BMC Helix Remedyforce PasswordString

BMC Helix Remedyforce Password

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.

Client IdStringConnected App Client Id
Client SecretStringBMC Helix Remedyforce Client Secret
Approved Check ScriptString

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 BMC Remedyforce 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.

    Tip

    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

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 BMC Remedyforce 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 pollBooleanDisable automatic polling (every minute) of BMC Helix tickets for status changes. Check if using REST API to communicate status changes to FlexDeploy.
Specified Object URLStringObject Name URL (/services/data/vXX.X/sobjects/{OBJECT_NAME})
Category IdStringCategory FK Id (e.g a216g0000005NvDAAU)

Freshworks Freshservice Properties

Additional Info ScriptString

@since 5.5.0.2

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 pollBooleanDisable automatic polling (every minute) of BMC Helix tickets for status changes. Check if using REST API to communicate status changes to FlexDeploy.
Specified Object URLStringObject Name URL (/services/data/vXX.X/sobjects/{OBJECT_NAME})
Category IdStringCategory FK Id (e.g a216g0000005NvDAAU)

Freshworks Freshservice Properties


Property
Type
Description
Freshservice URLStringFreshservice URL (https://<your_helpdesk_domain_name>.freshservice.com)
Freshservice API KeyString

API key for Freshservice

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.

Approved Check ScriptString

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 Freshservice 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.

    Tip

    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

A Groovy expressions which determines whether a task for

the

a change ticket is

approved

rejected or not.  The expression must return a boolean, and as has access to the following variables:

TICKET 
  • TICKET - an object with fields (JSON) contained in the change ticket, as returned by the Freshservice 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.
Tip

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
  • request or associated pipeline stage.
Additional Info ScriptString

@since 5.5.0.2

A Groovy expressions which determines whether a task for a change ticket is rejected or notexpression which determines additional information to add to an external approval when it is approved or rejected.  The expression must return a boolean, and as 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 Freshservice 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 pollBooleanDisable automatic polling (every minute) of Freshservice tickets for status changes. Check if using REST API to communicate status changes to FlexDeploy.
Freshservice Requester IdStringFreshservice agent id for API access(should be a number)

Jira ITSM Properties


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.
  • associated pipeline stage.


Property
Type
Description
Jira URLStringJira URL (http://myjira.atlassian.net)
Jira UserStringJira User Name
Jira API TokenString

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

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

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

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

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
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.


Code Block
languagegroovy
themeEclipse
titleDefault Check
TICKET.fields.status.name == 'Awaiting implementation' || TICKET.fields.status.name == 'Implementing' || TICKET.fields.status.name == 'Completed'


Code Block
languagegroovy
themeEclipse
titleDefault CheckExample that checks custom field value specific to target environment
(TICKET.fields.customfield_10107.status.name == 'Awaiting implementationUATApproved' || TICKET.fields.status.name == 'Implementing'&& FD_ENVIRONMENT_CODE='UAT') || (TICKET.fields.customfield_10107.status.name == 'Completed'PRODApproved' && FD_ENVIRONMENT_CODE='PROD')
Code Block
languagegroovy
themeEclipse
titleExample that checks custom field value specific to target environment
(TICKET.fields.customfield_10107.status == 'UATApproved' && FD_ENVIRONMENT_CODE='UAT') || (TICKET.fields.customfield_10107.status == 'PRODApproved' && FD_ENVIRONMENT_CODE='PROD')
Tip

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


A Groovy expressions which determines whether a task for a change ticket is rejected or not.  The expression must return a boolean, and as
Tip

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

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

@since 5.5.0.2

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
Jira ITSM
  • 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
. InfoIf 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
  • .
Don't pollBooleanDisable 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.


...