Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

how to show specific assignment groups from parent to child tasks

LakshmannaP
Tera Contributor
 
9 REPLIES 9

Hi @LakshmannaP 

 

For your use case -

 

 

Create an After insert/update Business Rule

  • Navigate to System Definition > Business Rules and click New.
  • Name: Sync Assignment Group to Child Tasks
  • Table: Choose your specific task table
  • When to run: Set When to after, check Update, and set the condition to: Assignment Group changes.
  • Action tab: Leave blank (we will use a script for cascading).

 

(function executeRule(current, previous /*null when async*/) {

    if (current.assignment_group.nil()) {

        return;

    }

    var childTask = new GlideRecord(current.getTableName()); 

    childTask.addQuery('parent', current.sys_id);  // update Actual parent field in your child table

    childTask.query();

    while (childTask.next()) {

        if (childTask.assignment_group != current.assignment_group) {

            childTask.assignment_group = current.assignment_group;

            childTask.update();

        }

    }

})(current, previous);

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

@Tanushree Maiti Did you try using the same reference qualifier as parent on the child assignment group field?

Hi @Sandeep Rajput ,

 

Ref Qualifier - that is definitely an option .  For me alternative solution is easy , that's why shared.

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

@Tanushree Maiti My bad, I wanted to tag @LakshmannaP instead tagged you by mistake 

Sachin_Nasa
Kilo Sage

Hi @LakshmannaP ,

You can use a Dynamic Reference Qualifier if your requirement can be met using one of the available Dynamic Filter Options. Dynamic qualifiers are easier to maintain than scripted qualifiers because they do not require custom scripting.

To configure this:

  1. Open the Dictionary Entry for the Assignment Group field.
  2. Under Use reference qualifier, select Dynamic.
  3. Choose the appropriate Dynamic Filter Option that matches your requirement.
    Sachin_Nasa_1-1783446532882.png

    If you found this helpful, please mark it as Helpful and Accept as Solution so it can reach others too.


     


If you found this helpful, please mark it as Helpful and Accept as Solution so it can reach others too.

Thanks & Regards,
Sachin Narayanasamy