- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 04:48 AM
var sysId = fd_data.trigger.current.sys_id;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 02:26 AM
Hi @KM SN ,
Use fd_data.trigger:
- When working with Flow Designer, the fd_data.trigger object holds the information related to the event that triggered the flow.
- This is particularly useful when you want to access specific data or variables that were passed into the flow at the time it was triggered.
Access Current Variables:
- To access the current variables in the flow, you use the context provided by fd_data.trigger. This allows you to interact with the data that triggered the flow, such as records or specific field values
var baseUrl = gs.getProperty('glide.servlet.uri');
/* The sys_id for the record you want to link to */
var sysid=fd_data.trigger.current.sys_id;
/* Construct the URL to the specific record */
var link = baseUrl + 'nav_to.do?uri=change_request.do?sys_id=' + sysid;
/* Output the constructed link */
return '<a href="'+link+'">'+fd_data.trigger.current.number+'</a>' ;
Mark as Helpful if is works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2024 01:29 AM
It feels like the integration isn't transferring the link in the way you expect, because it is generated in ServiceNow as clickable link with the number as display value. You may need to configure this in Jira.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 05:23 AM
I think there are couple of issues in your code -
Try this :
var sysId = fd_data.trigger.current.sys_id;
var url = 'Click the following to view the Change record: <a href="' + gs.getProperty('instance_name') + '/nav_to.do?uri=change_request.do?sys_id=' + sysId + '">Click here</a>';
return '[code]' + url + '[/code]';
Please mark this answer as helpful if it resolved your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 06:31 AM
Try this:
var sysId = fd_data.trigger.current.sys_id;
var instanceUrl = gs.getProperty('glide.servlet.uri');
var url = instanceUrl + 'nav_to.do?uri=change_request.do?sys_id=' + sysId;
var clickableLink = 'Click the following to view the Change record: [' + url + '](' + url + ')';
return clickableLink;
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 10:59 AM - edited ‎08-27-2024 11:00 AM
@Mark Manders Thanks for reply , BTW its generating two links side by side. Anyhow its showing the total URL.
can't we embed the hyper link to the change request number instead of actual URL. It is the target I am trying for... if you guide on it... that would be so helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2024 11:18 PM
var sysId = fd_data.trigger.current.sys_id;
var number = fd_data.trigger.current.number; // assuming this is the record with the change number
var instanceUrl = gs.getProperty('glide.servlet.uri');
var url = instanceUrl + 'nav_to.do?uri=change_request.do?sys_id=' + sys_id;
var clickableNumber = <a href="' + url + '"> + number + '</a>;
return clickableNumber;
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark