- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-28-2020 03:18 AM
Hi All,
we have an requirement, to restrict the incident that which already present in 'Incident Fix by change' tab should not be able to select on the 'Incident caused by change tab' on change Module.
Incident Module:
On the Incident form also, Change request which is selected on the 'change request' reference field. Should not be able to select on the caused by change
Pls suggest how we can achieve this requirement
Thanks
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-28-2020 03:49 AM
For incident form
For those 2 fields you will have to add reference qualifier for Caused by Change field
1) Go to configure dictionary of Caused by Change
2) In the advanced view select the reference qualifier as below in the advanced
javascript: 'sys_id!=' + current.rfc;
If you wish the same to happen for Change Request i.e CHG selected in Caused by Change should not be allowed in Change Request then do this
javascript: 'sys_id!=' + current.caused_by;
For Change Form: In order to restrict from adding same incident in "Incident Caused by change" do this
1) create before insert/update BR on incident table
Condition: current.caused_by != ''
2) Check if this CHG getting added in Incident's form "Caused by Change" field or not
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var chg = current.caused_by;
if(current.rfc == chg){
gs.addErrorMessage('You are not allowed to same CHG in Caused by Change for this incident');
current.setAbortAction(true);
}
})(current, previous);
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-28-2020 03:49 AM
For incident form
For those 2 fields you will have to add reference qualifier for Caused by Change field
1) Go to configure dictionary of Caused by Change
2) In the advanced view select the reference qualifier as below in the advanced
javascript: 'sys_id!=' + current.rfc;
If you wish the same to happen for Change Request i.e CHG selected in Caused by Change should not be allowed in Change Request then do this
javascript: 'sys_id!=' + current.caused_by;
For Change Form: In order to restrict from adding same incident in "Incident Caused by change" do this
1) create before insert/update BR on incident table
Condition: current.caused_by != ''
2) Check if this CHG getting added in Incident's form "Caused by Change" field or not
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var chg = current.caused_by;
if(current.rfc == chg){
gs.addErrorMessage('You are not allowed to same CHG in Caused by Change for this incident');
current.setAbortAction(true);
}
})(current, previous);
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-30-2020 05:21 AM
Hi Ankur,
The Br is working as expected, even though we don't give the reference qualifiers on 'Caused by Change' & "Change Request' Dictionary
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-30-2020 05:44 AM
Glad to hear
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader