Application Lifecycle Conductor

Expand all | Collapse all

CA ALC/CA SDM Integration - How to sync assignees

  • 1.  CA ALC/CA SDM Integration - How to sync assignees

    Posted 04-18-2018 01:31 PM

    Hi, please your suggestions.

     

    There is any way to sync the CA SDM Change Order Assignee with the CA ALC Project Assignee? We're using a pooling job (schedule tasks with Remote Record Field Import rule) in order to import CA Change Orders as CA ALC Projects based on some criteria and in fact we could sync some attributes like priority, summary and description, but we're unable to sync the assignee (Same user account with same user id already exists in both CA SDM and CA ALC).

     

    Thanks for your suggestions.

    Best Regards,

    JOHN



  • 2.  Re: CA ALC/CA SDM Integration - How to sync assignees

    Broadcom Employee
    Posted 04-27-2018 04:46 PM

    Hi John,

    Are you using a Remote Record Field Import Rule with an underlying ALMRemoteRecSynchronizer in the underlying rules script or chaining Remote Record import rule types?  There is definitely a way to do it, but it will depend on the method you are using.  If possible please post a sample of the underlying rule script (if any) and a screen shot of the rule for the Remote Record Import Rule.

    Thanks,
    Vaughn



  • 3.  Re: CA ALC/CA SDM Integration - How to sync assignees

    Posted 05-03-2018 11:51 AM

    Hi, thanks for your comment.

     

    First, we are using a schedule job (pooling) with a remote Record Field Import rule. This job works fine with this sample local and remote fields. But, we're unable to make it work with the 'assignee.userid' remote field mapped to 'assignee' local field (also try as 'assignedto')

     

    Any suggestion?

    Regards,
    JOHN



  • 4.  Re: CA ALC/CA SDM Integration - How to sync assignees

    Broadcom Employee
    Posted 05-04-2018 01:37 PM

    In the script override for the Remote Record Field Importer, you should have something like this:

     

    var importer = new Packages.purescm.vegas.plugins.ALMRemoteRecSynchronizer(

           executingRule,                                         // Mapping Rule

           remId,                                                 // Filter

           extraInfo,                                             // Extra Info

    Packages.purescm.vegas.plugins.StmUtil.getItemTypeName(Packages.purescm.vegas.plugins.StmUtil.getDefectId(), securityContext),                                            // Import To Item Type

           "purescm.vegas.plugins.jira.JiraIssueConnector",     // Connector ID

           null,                                                  // Attachment Filter

           null,                                                  // Attachment Extra Info

           null,                                                  // Attachment Connector ID

           false,                                                 // Allow Delete Local Attachments

           proj,                                                  // Link To Item

           impByRelTypeStr,                                      // Relationship Type

           true,                                                  // Implied Relationship

           excl,                                                  // Rule Exclusion List

           true,                                                  // Do Percent Complete At End

           rulesToken,                                            // Rules Access Token

           securityContext,                                      // Security Context

           true,                                                  // Async Import

           null,                                                  // Field Mapping Listener

           null,                                                  // Attachment Extra Info Decrypt/Encrypt Listener

           null);                                                 // Import Listener

    importer.start();

     

    The import listener (highlighted in yellow above) allows you to modify the records before save.  With this you can translate the info coming in from the assignee in SDM to the correct format for ALC.  The SDM record contains the info needed in two fields (Assignee first name and Assignee last name) and ALC needs the value to be a Person org entry.  So you would do something like this:

     

    obj = {

        itemImported: function(remRec, item, beforeSave, importCtx) {

            if (beforeSave) {

                // Get assignee name

                var assignName = new java.lang.StringBuilder();

                var flds = remRec.getFieldNames();

                var vals = remRec.getValues();

                for (var f = 0; f < flds.size(); f++) {

                    if (flds.get(f).equals("assignee.first_name")) {

                        if (vals.get(f) != null && !vals.get(f).equals("")) {

                            assignName.append(vals.get(f));

                        }

                    } else if (flds.get(f).equals("assignee.last_name")) {

                        if (vals.get(f) != null && !vals.get(f).equals("")) {

                            if (assignName.length() > 0)

                                assignName.append(" ");

                            assignName.append(vals.get(f));

                        }

                    }

                }

                // Find person

                var people = VegasClient.getVegasObjectsForCollection(Packages.purescm.vegas.engine.People, 0,

                      null, securityContext, 0);

                for (var p = 0; p < people.size(); p++) {

                    if (people.get(p).getName().equals(assignName.toString())) {

                        item.setAssignee(people.get(p));

                        item.persistChanges();

                        break;

                    }

                }

            }

        },

        forceUpdate: function(remRec, itemId) {},

        importComplete: function(updatedItemIds) {}

    };

    var impListener = new Packages.purescm.vegas.plugins.ALMRemoteRecSynchronizer.ImportListener(obj);

     

    var importer = new Packages.purescm.vegas.plugins.ALMRemoteRecSynchronizer(

           executingRule,                                         // Mapping Rule

           remId,                                                 // Filter

           extraInfo,                                             // Extra Info

    Packages.purescm.vegas.plugins.StmUtil.getItemTypeName(Packages.purescm.vegas.plugins.StmUtil.getDefectId(), securityContext),                                            // Import To Item Type

           "purescm.vegas.plugins.jira.JiraIssueConnector",     // Connector ID

           null,                                                  // Attachment Filter

           null,                                                  // Attachment Extra Info

           null,                                                  // Attachment Connector ID

           false,                                                 // Allow Delete Local Attachments

           proj,                                                  // Link To Item

           impByRelTypeStr,                                      // Relationship Type

           true,                                                  // Implied Relationship

           excl,                                                  // Rule Exclusion List

           true,                                                  // Do Percent Complete At End

           rulesToken,                                            // Rules Access Token

           securityContext,                                      // Security Context

           true,                                                  // Async Import

           null,                                                  // Field Mapping Listener

           null,                                                  // Attachment Extra Info Decrypt/Encrypt Listener

           impListener);                                         // Import Listener

    importer.start();