Copying incident's short description to its child task before submitting the task

mfhaciahmetoglu
Mega Sage

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

 

  

1 ACCEPTED SOLUTION

@mfhaciahmetoglu 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

11 REPLIES 11

@mfhaciahmetoglu 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar , ah, that works indeed! 

 

So no need for GlideAjax or g_scratchpad object, interesting!

 

Thanks!

 

Best,

Firat