- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
I have created a UI Action on the sc_task table and added the below code for Creating a Standard Change:
var url = new StdChangeUtils().getURLForTask(current, 'rfc');
url += '&sc_task_sys_id=' + current.sys_id;
action.setRedirectURL(url);
It is redirecting to standard change template for creating new change request but linkage of sctask is not happening on that change request parent field.
Question:
Is there a way to implement this functionality so that the originating SCTASK is linked to the Change Request created via the Standard Change template?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
it worked for me now
Update your UI action as this -> don't send task sysId, no need of this
var url = new StdChangeUtils().getURLForTask(current, 'rfc');
action.setRedirectURL(url);
client Script as this -> the task sysId is already present in URL, use regex and grab that and set
function onLoad() {
//Type appropriate comment here, and begin script below
var url = top.location.href;
var regex = /sysparm_processing_hint=table:sc_task;sysid:([a-f0-9]{32})/;
var match = url.match(regex);
if (match && match[1]) {
var taskSysId = match[1];
alert(taskSysId);
// Use sysId as needed
}
}
Output:
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
There is no need to create a UI action. You can add the related list of changes, click New, and it will take you to the change description. There, you can select the same change as you want to standardize.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
i want to create from standard change template and that templated value should get append to sctask field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
So, you want to use the SC change template to populate an SC task—that’s not possible. You can create it as mentioned. SC Task and SC Change are two different records.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I shared solution for something similar recently
use onLoad client script and try to get sc_task_sys_id from URL and set it in parent field on CHG
How to Create Standard Change from RITM and relate ?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
