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

How to call a folder in DNG for API script appending name

 I have a script that appends the name of our DNG artifacts based on artifact type and a few custom attributes. I'd like to add a folder call into the name appending script but am not sure out to do it. The folder does not seem to be a part of the RM.Data container in the script catalog. Any ideas?

Here's a snippet from my code:

// Change Names to include abbreviations
changeName = function(ref){
//API Call to get attributes from the artifact
   RM.Data.getAttributes(ref, [RM.Data.Attributes.NAME, RM.Data.Attributes.ARTIFACT_TYPE, RM.Data.Attributes.IDENTIFIER, 'Level', 'System'], function(result){
      var artType, artID, artName, artName2;
      var level, system;
      if(result.code != RM.OperationResult.OPERATION_OK){
console.log("error: ", result);
  }
  else{
      console.log("worked");
    // Build up data to save here
    var toSave = [];
   
    // For each artifact save the attributes that we will need to use or append
    result.data.forEach(function(item){

for(var prop in item.values){

if (prop == RM.Data.Attributes.NAME){
artName = item.values[prop];
}
if (prop == RM.Data.Attributes.ARTIFACT_TYPE){
artType = item.values[prop];
}
if (prop == RM.Data.Attributes.IDENTIFIER){
artID = item.values[prop];
}
if (prop == 'Level'){
level = item.values[prop];
}
if (prop == 'System'){
system = item.values[prop];
}
}

0 votes

Comments

I checked the RM Extension API specification and could see no "folder" at all. And "parent" does not appear as an attribute either. I guess you're out of luck here.


Be the first one to answer this question!

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,938

Question asked: Feb 10 '16, 1:10 p.m.

Question was seen: 2,787 times

Last updated: Feb 10 '16, 7:41 p.m.

Confirmation Cancel Confirm