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.
Image Modified
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 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 - 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 |
---|
language | groovy |
---|
theme | Eclipse |
---|
title | Simple Example which is used by default |
---|
| TICKET.approval == 'approved'
|
Code Block |
---|
language | groovy |
---|
theme | Eclipse |
---|
title | Example 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 |
---|
language | groovy |
---|
theme | Eclipse |
---|
title | Check if now is between start_date and end_date defined on ticket |
---|
linenumbers | true |
---|
| 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 Script | String | 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 |
---|
language | groovy |
---|
theme | Eclipse |
---|
title | Simple Example which is used by default |
---|
| TICKET.approval == 'rejected'
|
Code Block |
---|
language | groovy |
---|
theme | Eclipse |
---|
title | Example that checks myfield value specific to target environment |
---|
| (TICKET.myfield == 'UATRejected' && FD_ENVIRONMENT_CODE='UAT') || (TICKET.myfield == 'PRODRejected' && FD_ENVIRONMENT_CODE='PROD')
|
|
Don't Poll | Boolean | Returns 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 is used to communicate ticket approval/rejection. |
...