- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 03:02 AM
Hello,
I am stuck with a requirement.
The requirement is simple. We have a Jira Task that we create from Incident (so the the incident is the parent of the jira task). We want to copy the short description of the incident to the summary field of Jira task, which should be displayed before the submission so that the user can see the copied information and edit if required.
I wrote a BR. But because it is on server-side, it only works when I submit the Jira task. What I want, however, is that once the user navigates to Jira task form to create a jira task, short description should already appear before I submit the form.
How can I achieve this?
Best,
Firat
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 05:31 AM
then use this in display business rule
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.fieldName = current.parent.short_description;
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-27-2025 03:06 AM
You can make use of Onload client script to get this requirement achieved.
Script:
function onLoad() {
var incidentSysId = g_form.getReference('incident');
if (incidentSysId) {
var gr = new GlideRecord('incident');
if (gr.get(incidentSysId)) {
var shortDescription = gr.short_description;
g_form.setValue('summary', shortDescription);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 03:11 AM
Hi @Nilesh Pol - Don't you think gr.get(incidentSysId)
runs on the server, but this is a Client Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 03:08 AM
(Client Script + Script Include).
I think first you need to write a Client Script which once triggered will retrieve the Incident Sys ID from the parent field, now with the Script Include using GlideAjax
we will fetch the Short Description.
Once the response is received, it sets the Summary field in the Jira Task form and the user can see the copied Short Description before submitting.
Thanks,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 03:18 AM
You should look at the process of creating the Jira Task from an Incident. If you are using a UI Action, API, (or...?) incorporate copying the short description from one to the other within this script, similar to how the Incident is getting set as the Parent of the the Task, instead of on the new task record if possible.