Add link to Issue record in Business Rule Message on Remediation Task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 02:02 PM
When a Closed state is selected (Closed Complete, Closed Incomplete, Closed Cancelled) and record is saved or updated then a message will appear stating "You have closed your Remediation Task. You may also wish to close the associated Issue <link>."
how do I add a link to the associated issue records on the business rule message that is on the remediation task table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 04:02 PM
Hi @RandiReyna,
You can add a hyperlink with a URL like below:
/sn_grc_issue.do?sys_id=${current.issue.sys_id}
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 05:37 PM
Hi @James Chun ,
I added the link but it creates a new record instead of going to issue record thats for the remediation task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 06:02 PM
Hi @RandiReyna,
How are the Remediation Task and Issue records related?
I thought they were related via the Issue field on the Remediation Task record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2024 01:47 AM
Hello,
Navigate to Business Rules:
- Go to
System Definition
>Business Rules
.
-
Create a New Business Rule:
- Click
New
to create a new business rule.
- Click
-
Configure the Business Rule:
- Name:
Notify on Closed Remediation Task
- Table:
Remediation Task
- When:
after
- Insert:
true
- Update:
true
- Name:
-
Add Conditions and Script:
In the
Advanced
tab, check theAdvanced
checkbox to enable scripting. Then, add the following script:(function executeRule(current, previous /*null when async*/) { // Define the closed states var closedStates = ['Closed Complete', 'Closed Incomplete', 'Closed Cancelled']; // Check if the state is changed to one of the closed states if (closedStates.indexOf(current.state) !== -1 && current.state !== previous.state) { // Get the associated Issue record (assuming it is linked via a reference field 'issue') var issueSysId = current.issue; if (issueSysId) { // Generate the link to the Issue record var issueLink = '<a href="/issue.do?sys_id=' + issueSysId + '">Issue</a>'; // Set the message gs.addInfoMessage('You have closed your Remediation Task. You may also wish to close the associated ' + issueLink + '.'); } else { // If no issue is associated, just show the message without the link gs.addInfoMessage('You have closed your Remediation Task.'); } } })(current, previous);
-
Save the Business Rule:
- Click
Submit
to save the business rule.
- Click
This script checks if the state of the Remediation Task has changed to one of the closed states. If it has, it retrieves the associated Issue record (assuming it is stored in a reference field named issue
), generates a link to that Issue, and displays a message with the link.
Regards,
Vaishnavi Lathkar