- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2022 03:56 AM
- Whenever any new Demand is created with Company as TECHS, new Demand Task will be automatically created.
The number of demand tasks created will depend on the number of values in the 'Business application' field in the demand record . if there are two values in the 'Business application' field then there will be two tasks created one for each business application.
Note-Business application is a List collector
The field mapping would be :
Priority- 2
shortdescription- task created for $business application
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 01:04 AM
For your second part of query, for setting the priority as None but it's not happening because Priority is a Field on Task Table and has a Default value being set in it as shown below which is 4 i.e. Low and hence when ever a task is getting created it is setting it as Low:
Now in order to override this , Right click on Priority field and select Configure Dictionary and then scroll down to Dictionary Override as shown below:
Click on New Button:
Select Table as Demand Task and then select the check box as Override Default Value and leave it blank value in below field of Default value:
Now when your Demand Task will be created the priority value will be empty as you want as shown below:
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2022 04:05 AM
HI Shyna,
The below thread will help you:
https://community.servicenow.com/community?id=community_question&sys_id=a7cf31861b2bb810fc3233bc1d4bcbdc
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2022 04:18 AM
Hi,
Please write a After Insert Business Rule on Demand table and use the script as below:
Condition of BR:
Company is TECHS AND business Application is Not Empty
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var getCurrentBusinessApplications = current.business_applications;
var splitApplications = getCurrentBusinessApplications.split(',');
for(var i=0;i<splitApplications.length;i++){
createDemandtask();
}
function createDemandtask(){
var gr = new GlideRecord('dmn_demand_task');
gr.initialize();
gr.parent = current.sys_id;
gr.FIELDNAME = current.FIELDNAME; // Replace "FIELDNAME" in case you want to copy field values as well
gr.insert();
}
})(current, previous);
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2022 04:21 AM
For example have tested the above code and it works correctly. I have two Business Applications on my Demand form and hence two Demand Task got created as shown below.
If you want to copy field values from Demand to Demand task while creating task you can replace those field in place of Field Name in script above.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 12:35 AM
Hi Shloke,
Thank you so much for the script.
One more challenge i am facing - I want the short description of the demand task created for each business application to have the Business application populated in the short description.Like
If there are two application like attendance payroll management and event management , the short description of the two tasks created should have following business application name populated.one task with one business app name populated.
One more thing if i were to set the priority value to None for the demand task , how should i do it
i am setting urgency and impact value to null still the priority value is taking as priority 5