Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to set short description for catalog task for the selected job function?

Siva P
Tera Expert

Hi ,

I have catalog item with the filed called request type, it is a choice field we have multiple choices. When user selects some of the choices from the dropdown and clicks order now . Then it will create a RITM and attached with catalog task.

Now i need set the catalog task short description field with some text based on the selected choice for catalog item filed.

Please help me how to achieve this. Thanks in advance.

1 ACCEPTED SOLUTION

Hi Ankur,

I have given filter condition like below but the values which are not storing in worknotes.

 

Script:

var str = '';
if(current.u_actual_effort != '')

str = str + previous.u_actual_effort + ' ';

if(current.u_week_and_month != '')

str = str + previous.u_week_and_month;

current.work_notes = str;
})(current, previous);

View solution in original post

21 REPLIES 21

It would be form like,

if(current.variables.variable_name=='admin')
{
}
else if (current.variables.variable_name=='abc')
{
}
else if{
}

 

Hi,

you can use switch case as well

var value = current.variables.<variableName>;

switch(value) {

case "abc": task.short_description = ''; // specific description

case "def": task.short_description = ''; // specific description

case "xyz": task.short_description = ''; // specific description

}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Please consider marking appropriate reply as Correct & 👍Helpful.

Regards
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

@sambasiva 

Is this answered?

if my answer helped you, kindly mark it as Correct & 👍Helpful so that others can benefit from similar question in future.

Regards
Ankur

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

Yes ..Ankur..its helpful full to me.. I have one more small requirement. I have a custom field on my sctask form .how to store/capture this field value in worknotes or additional comments only for this one task get created..it should not effect all sctasks. Is this possible?