Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

DNG Changeset in RM Client Extension

 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

0 votes



One answer

Permanent link
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

1 vote

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Jan 01 '22, 5:09 p.m.

Question was seen: 1,085 times

Last updated: May 28, 5:52 a.m.

Confirmation Cancel Confirm