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 create a task on condition

LK11
Mega Expert

I'm a ServiceNow beginner and I'm wondering if someone could help me with this please.

I have to create a task for a particular team if the user chooses 'yes'   for a condition on the form.   Any suggestions would be great.

Thank you

1 ACCEPTED SOLUTION

Arindam Ghosh
Mega Guru

Hello,



If you want this for Service catalog then You need to do this in Workflow. Create a if block with the below condition and create task if condition is yes.



Here is the sample screenshot:


find_real_file.png


Script:


answer = ifScript();



function ifScript() {


if (current.variables.field_name == 'true') { // Update the field name with original field name


return 'yes';


}


return 'no';


}



Thanks,


Arindam


View solution in original post

13 REPLIES 13

Can you post the screenshot of the Change WF. By the way what change is it? Normal/Standard/Emergency?


Normal Change



find_real_file.png


In the Workflow in the below block one more WorkFlow is being called



find_real_file.png



The name of the other WorkFlow is : Change Request - Normal change tasks where task is being created.



Below is the screenshot Where task is created:



find_real_file.png



Now to create the two new more task You need to add to more create task block in Change Request - Normal change tasks workflow like Below screenshot:



find_real_file.png



Thanks,


Arindam


wow, totally looked over that,,


now i see it..


thx so much Arindam