Versions Compared

Key

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

Change Management System instance has configuration details necessary to connect to specific Change Management System. This is used to query Change Tickets, and optionally create Change Ticket or Incidents. This is used during project deployment executions. Each instance is defined with unique name and code, and in addition has underlying system specific properties for connection.

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

...

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

...

Field Name

Required

Description

Instance Code

Yes

Short name for the instance.  As the code is available as Groovy and Shell variables it must not contain spaces or other special characters, aside from underscores.

Instance Name

Yes

Long display

Display name for the instance.

Change Management

Yes

The change management system.

Description

Yes

No

A meaningful description of the instance.

Active

Yes

Whether or not the instance is active in the system. Defaults to "Yes" when creating a new instance.

If the selected Change Management System has any properties defined, enter the values for those properties.

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 the Apply button to save the changes, but remain on the current screen until the the Cancel button is clicked.

ServiceNow Properties

...

Property

...

Type

...

Description

...

ServiceNow URL

...

String

...

The URL for accessing ServiceNow.

...

ServiceNow Port

...

String

...

The HTTP/HTTPS port for ServiceNow.  If you don't typically specify a port on the URL, provide the default (80 for HTTP and 443 for HTTPS).

...

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.

...

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 (as of 4.5.2) - an object with fields (JSON) contained in the change ticket, as returned by the ServiceNow REST API.  Fields are referenced as TICKET.<field name>.
  • REQUEST (deprecated as of 4.5.2) - same object as TICKET.
  • FD_ENVIRONMENT_CODE (as of 4.5.2) - 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.

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;

# Assuming API returns start_date like 2020-05-08 14:29:20 and end_date like 2020-05-09 14:09:26
# Additionally code below assumes that String returned for date is in GMT TimeZone.
# convert to Java Date object from String so comparison can be done
Date start = FlexDateTimeUtils.stringToDate(start_date, "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT"));
Date end = FlexDateTimeUtils.stringToDate(end_date, "yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT"));
Date now = new Date();
# Now let's check if now is between two dates.
if(now.after(start) && now.before(end))
{
    return true;
}
return false;

...

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 (as of 4.5.2) - an object with fields (JSON) contained in the change ticket, as returned by the ServiceNow REST API.  Fields are referenced as TICKET.<field name>.
  • REQUEST (deprecated as of 4.5.2) - same object as TICKET.
  • FD_ENVIRONMENT_CODE (as of 4.5.2) - 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')

...

 button is clicked.