- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-08-2022 07:08 PM
Hi all,
We have a requirement whenever user clicks on new change request in related list from RITM for normal , emergency change variables on RITM should get populated in description.
I tried using the script on OOB UI action but no result , Can anyone help with the script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-09-2022 12:28 AM
Hi,
then use display business rule on change_request and same script
it will work
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.getValue('parent'));
var arr = [];
var variables = ritm.variables.getElements();
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if(label != '' && value != ''){
arr.push(label + ":" + value + "");
}
}
current.description = arr.join('\n');
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
ā02-28-2023 01:59 PM
Hi @Ankur Bawiskar , How to copy the variables from sctask to story. I don't find any table on SC Task that stores variable label and value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-28-2023 06:52 PM
what's the relationship between sctask and story?
your sctask will have RITM from where you can pick the variables
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-16-2023 06:18 AM
There is a 'Create Story' UI action on sc task. When user clicks on it, all the variables(from variable editor) from sc task should be copied to story. We have variables which are visible only on sc tasks but not on RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-16-2023 06:34 AM
can you post a new question for this and tag me there as this is an older thread?
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-16-2023 06:52 AM
Created a new post and tagged you. Thank you.