It's all about the answers!

Ask a question

DNG Changeset in RM Client Extension


Chandan M B (1134080) | asked Jan 01 '22, 5:09 p.m.
edited Jan 01 '22, 5:10 p.m.

 Hello,


I am trying to develop the DNG client extension.This widget needs to be executed in changeset context.
So, could you please provide us some leads how to check whether the user in changeset context or not.


I tried using RM.Client.getCurrentConfigurationContext which is unsuccessful.
I am hinting should i use rest api or oslc api (private apis) to check whether the user in changeset context or not ?
If so, sample uri would be helpful

Regards,
Chandan

One answer



permanent link
Jean-François CHAPELLE (6414) | answered May 28, 5:52 a.m.
A sample Javascript code to get the local configuration context and test if a Changeset exists or not :

function get_ChangeSetConfig (replaceFunction, artifactList, searchString, replaceString) {
   RM.Client.getCurrentConfigurationContext (function (result) {
      $("#" + GUI_ITEM_MSGERROR).hide();
      if (result.code === RM.OperationResult.OPERATION_OK) {
         const COMPONENT_CONTEXT = result.data;
         if (COMPONENT_CONTEXT.changeSetUri === undefined || COMPONENT_CONTEXT.changeSetUri === null) { // ---- ChangetSet is mandatory to use this widget !
            $("#" + GUI_ITEM_MSGERROR).text(MSG_ERR_0004);
            $("#" + GUI_ITEM_MSGERROR).show();
         } else { // ---- Launch replace operation
            replaceFunction (artifactList, searchString, replaceString);
         }
    } else { // ---- Other error
         $("#" + GUI_ITEM_MSGERROR).text(MSG_ERR_0005);
         $("#" + GUI_ITEM_MSGERROR).show();
      }
   });
}
Enjoy

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.