Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML<style> .release-box { height: 30px; width: 70px; padding-top: 8px; text-align: center; border-radius: 5px; font-weight: bold; background-color: #F4D942; border-color: #FCE28A; } .release-box:hover { cursor: hand; cursor: pointer; opacity: .9; } </style> <meta name="robots" content="noindex"> <div class="release-box"> <a href="

UI Button
colormagenta
tooltipInformation on this page pertains to the Perspectium Fluorine release
titleFluorine
url

https://docs.perspectium.com/display/

gold" style="text-decoration: none; color: #FFFFFF;"> Gold </a> </div>

fluorine


Script actions are server-side scripts triggered by events that can modify configuration items in your ServiceNow instance. The script action that you will need to edit in this step will create an outbound message for any incident records that have attachment data included, thus ensuring that any attachments you have uploaded in your ServiceNow incidents are successfully shared out to your Jira instance.


Procedure

To edit the Perspectium synchronize Jira attachment script action in ServiceNow for a multi-app ServiceBond integration, follow these steps:


UI Steps


UI Step

Navigate to Script Actions

Log into your ServiceNow instance and navigate to System Policy Events Script Actions


UI Step

Update the Perspectium synchronize Jira attachment script action

Click into the Perspectium synchronize Jira attachment script action with an event name of attachment.uploaded. Then, update the script as follows:

pspShareJiraUploaded();

function pspShareJiraUploaded() {
var pspRepl = new PerspectiumReplicator();
var pspCor = new PerspectiumCorrelation();

var tableName = event.parm1;
var tableSysId = event.parm2;

var tgr = new GlideRecord(tableName);
tgr.addQuery('sys_id', tableSysId);
tgr.queryNoDomain();
if (!tgr.next()) {
return;
}

var op = "update";

var cgr = pspCor.getCorrelationRecord(tgr, '', 'jira');
if (tgr.operation() == "insert" || cgr == null || (cgr && cgr.u_correlation_id == '')) {
op = "deferred";
}

var tUtils = new TableUtils(tableName);
var tables = tUtils.getTables().toString();
var tableStr = tables.substring(1, tables.length() - 1);

var qc = new GlideRecord('psp_replicate_conf');
qc.addQuery('table_name','IN', tableStr);
qc.addQuery("sync_direction", "share");
qc.addQuery("active", "true");
qc.addQuery("u_target_queue.u_name", "psp.in.siam.client.jira");
qc.query();
while(qc.next()) {
// reset the message set counter each time we do a new share configuration
pspRepl.messageSetCounter = {};

var startedDateTime = gs.nowDateTime();
// share record, setting tag to mark attachments
pspRepl.shareOneRecord(tgr, qc, tableName, op, 'jira_sent');
var finishedDateTime = gs.nowDateTime();

// send message set for each share configuration we send attachments for
pspRepl.pspMS.createMessageSetProcessed(pspRepl.messageSetCounter, qc, pspRepl.getKey(qc), startedDateTime, finishedDateTime);
}
}

Then, click Update in the bottom left-hand corner of the form to save the changes to this script action.





Next steps


Bond your ServiceNow incidents with Salesforce cases and Jira issues (multi-app integration)



Similar topics


Content by Label
showLabelsfalse
max5
showSpacefalse
sortmodified
cqllabel in ("service-bond","servicenow") and space = "gold"

Contact Perspectium Support


US: 1 888 620 8880

UK: 44 208 068 5953

support@perspectium.com