Highlighted
Absent Member.. Absent Member..
Absent Member..
329 views

Activity updates cascade from parent tt to child tt

Hi All,

 

We have requirement that, when ever there is any activity update in the parent TT, it should be cascaded to its respective child TTs.

 

 

We have written a java script to query to sc relations table for child tts and mapped parent tt journal update to the child TT.

 

Issue here is, if we do any update to the child and after some time to the parent, child tt updates are getting  replaced by parent tts journal updates instead of appending to the child tts update.

 

Please help me if someone achieved similar requirement.

 

Thanks,

VND

 

 

 

 

 

0 Likes
3 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Activity updates cascade from parent tt to child tt

The appropriate utility to configure related activity updates between records would be interoperability ioevents/ioactions. Out of box, they are used to pass "customer visible" activity updates to the related interaction from IM and Change tickets. They also are used to update IM records If the problem they are linked to is closed.

You start by defining a new ioevent in the ioevents record for the table. The event will call the corresponding ioactions if the related condition evaluates to true. You can use the existing activity update events as a model for yours. You can access the ioevent and ioactions tables from database manager.
----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Activity updates cascade from parent tt to child tt

Hi John,

 

Thanks for your reply.

 

We managed to write a java script to cascade the activity updates from parent to child tts.

Script is working fine for single child TT.

 

If i associate multiple child TTs, only one child TT is getting updated and rest it is blank.

 

issue I observed is when the parent TT is updating, for the first TT $pmc.action and $apm.activity are returning values when it is try to update for next TT these values are returning null.

 

Is there any other approach to handle these variables in Java script.

 

please find below java script.

 

 

 

var prob = new SCFile("probsummary");

      //var file = system.vars.$file;

      //vars.$incId = vars.number;

      var number = record.number;

      var array = new Array();

      vars.$apm = vars.$apm_activity;

      vars.$pmc = vars.$pmc_actions;

     

     

      //var remark = vars.$file.vil_remarksms1;

      print("Number = "+number);

      //print("Number = "+remark);

      var scr = new SCFile("screlation");

      var prob = new SCFile("probsummary");

      //sql = "source=\"" + parent + "\""

    var h = scr.doSelect("source=\"" +number+ "\"")

    print("H = "+h);

    if (h== RC_SUCCESS )

    {

   

            var count = 1;

                  do

                  {

                        var dep = scr.depend;

                        array[count] = dep;

                        count++;

                  }

                  while (scr.getNext() == RC_SUCCESS);

           

            print("Count = "+count);

           

            for (count in array)

            {

                  print ("Child="+array[count]);

            }

    }

    if (count >1)

    {

            for (count in array)

            {

               print("For Loop Begins update ..."+count);

             if ( prob.doSelect("number=\"" + array[count] + "\"" ) == RC_SUCCESS )

             {

                        if (prob.problem_status != "Resolved" && prob.rel_type == "child")

                        {

                              prob.$apm_activity = vars.$apm;

                              prob.$pmc_actions = vars.$pmc;

                              //prob.vil_remarksms1 = remark;

                              var res = prob.doAction("ok");

                              //var res = prob.doUpdate();

                              print("Result = "+res);

                        }

                             

             }

          }

      }

 

 

Thanks,

VND

 

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Activity updates cascade from parent tt to child tt

I know this is an old post, but I couldn't locate an updated answer. I had a requirement to cascade a user activity comment to all related tickets. I accomplished the cascading of activity comment updates to all related open tickets by using rulesets with rule actions within workflows.

1. Create a ruleset for each table in which you want the activity comment posted. Example, one for probsummary and one for cm3r. You will use the rulesets in your workflows.

2. For the probsummary ruleset, add a JavaScript rule to create variables that will be used for the activities on the related tickets. In my case, I added a script to create an array for the update added to ticket. I then had a variable equal the array information. I also added a variable to identify the ticket number.

3. Add a Run action rule that looks for records in the screlation table. You can add you add you own filter, but I used a filter of ( Source !=NULL AND Source Active = true AND Depend = Number in CurrentRecord). Create a ruleset for screlation table. Add the ruleset and for action after Rule Set, select Do Nothing.

4. Go into the screlation ruleset you created and create two Run action rules with one rule condition to only run based on Source Filename problem and another rule condition to run based on Source Filename cm3r.

5. Follow the same instructions as step 3 for the two Run action rules, but update the table name and table condition to display (Number = Source in CurrentRecord). The caption "Number" may be different for your table, so use the field that identifies the ticket number. Create a ruleset for the final destination table. Add the ruleset and for action after Rule Set, select Do Nothing.

6. Within the final destination Rulset, add your script for adding and inserting an activity. Use the variables you created in the second step. The update variable can be used for the activity description. The number variable can be used for displaying as the activity type. For example, the activity type line on your script can equal vars.$number_variable + " Related Comment". (Assuming $number_variable is the variable name you gave it from step 2)

7. Add the 2 rulesets from step one to your workflows within Ruleset On Update (You can add on phase level, Workflow properties, etc).

8. When an activity comment update is added by a user, any related ticket will include the same activity comment and the Type of the activity will display the ticket number on where the activity originated.

 

Joe

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.