<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to create 4 tasks in incident by UI action Button on a form level? in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2915859#M52</link>
    <description>&lt;P&gt;How to create 4 tasks in incident by UI action Button on a form level through scripting?&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2024 05:40:50 GMT</pubDate>
    <dc:creator>krishna svg</dc:creator>
    <dc:date>2024-05-02T05:40:50Z</dc:date>
    <item>
      <title>How to create 4 tasks in incident by UI action Button on a form level?</title>
      <link>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2915859#M52</link>
      <description>&lt;P&gt;How to create 4 tasks in incident by UI action Button on a form level through scripting?&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 05:40:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2915859#M52</guid>
      <dc:creator>krishna svg</dc:creator>
      <dc:date>2024-05-02T05:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create 4 tasks in incident by UI action Button on a form level?</title>
      <link>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2915864#M53</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use below code in UI Action.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var grtask= new GlideRecord('incident_task');

for(var i = 0; i&amp;lt;4;i++){
grtask.initialize();

grtask.short_description=current.short_description;

grtask.assignment_group=current.assignment_group;

grtask.insert();

}

 
current.worknotes='Incident task is created-'+grtask.number;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If my answer has helped you in any way please mark it as correct or helpful.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 05:47:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2915864#M53</guid>
      <dc:creator>Vishwa Pandya19</dc:creator>
      <dc:date>2024-05-02T05:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create 4 tasks in incident by UI action Button on a form level?</title>
      <link>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2915941#M54</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/365750"&gt;@krishna svg&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Create One UI Button "Create Task"&lt;/P&gt;&lt;P&gt;Define the condition on which you want to be appear or visible UI button&lt;/P&gt;&lt;P&gt;Use this script for incident task&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var grtask= new GlideRecord('incident_task');

for(var i = 0; i&amp;lt;4;i++){
grtask.initialize();
grtask.incident=current.sys_id;//Link the incident with task record
grtask.short_description=current.short_description;
grtask.assignment_group=current.assignment_group;

grtask.insert();
grtask.update();

}
current.worknotes='Incident task is created-'+grtask.number;
current.update();
action.sendRedirectURL(cureent);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to create task only then&lt;/P&gt;&lt;P&gt;use this script&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var grtask= new GlideRecord('task');

for(var i = 0; i&amp;lt;4;i++){
grtask.initialize();
grtask.parent=current.sys_id;//Link the incident with task record
grtask.short_description=current.short_description;
grtask.assignment_group=current.assignment_group;

grtask.insert();
grtask.update();

}
current.worknotes='Incident task is created-'+grtask.number;
current.update();
action.sendRedirectURL(cureent);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;Seraj&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 07:07:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2915941#M54</guid>
      <dc:creator>Seraj</dc:creator>
      <dc:date>2024-05-02T07:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create 4 tasks in incident by UI action Button on a form level?</title>
      <link>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2916017#M55</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/365750"&gt;@krishna svg&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I tried your problem in my PDI and it works for me please refer below images and script&amp;nbsp;&lt;/P&gt;&lt;P&gt;I create UI action which is not client callable and added below script&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var taskGR = new GlideRecord('task');

for(var i = 0; i&amp;lt;4;i++){
taskGR.initialize();
taskGR.parent = current.sys_id;//Link the incident with task record
taskGR.short_description = current.short_description;
taskGR.description = current.description;
taskGR.assignment_group = current.assignment_group;

taskGR.insert();
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SarthakKashyap_0-1714635977177.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/352765iA49334E1E6C40620/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SarthakKashyap_0-1714635977177.png" alt="SarthakKashyap_0-1714635977177.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SarthakKashyap_1-1714636055045.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/352766iCDCD781DBE261A9E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SarthakKashyap_1-1714636055045.png" alt="SarthakKashyap_1-1714636055045.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I click UI Action - &lt;STRONG&gt;Create Task&lt;/STRONG&gt; it created&lt;STRONG&gt; 4 tasks &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SarthakKashyap_2-1714636118976.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/352768i2E648DA3D08A44DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SarthakKashyap_2-1714636118976.png" alt="SarthakKashyap_2-1714636118976.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please mark my answer correct and helpful if this works for you&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sarthak&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 07:49:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/how-to-create-4-tasks-in-incident-by-ui-action-button-on-a-form/m-p/2916017#M55</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2024-05-02T07:49:01Z</dc:date>
    </item>
  </channel>
</rss>

