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

How to create ArtifactRef object from existing uri

 I'm working on creating a tool to operate on all artifacts in all modules. Currently, it appears that the RM api provides capability to access only 1 module worth of artifacts, so I'm investigating a workaround. This includes getting each module's uri and operating on each individual module in sequential order. Am I able to generate/get an ArtifactRef from a uri?


If I can do this, then I can operate on all modules necessary at once, rather than having to navigate to each module while subscribed to the ARTIFACT_OPENED event to perform the action that I want.

0 votes


Accepted answer

Permanent link
Jake,

Please check following code. It should return the object.

let tmp = new RM.ArtifactRef(URI, COMPONENT_URI, null, FORMAT);
Jake Hadley selected this answer as the correct answer

0 votes

Comments

 Awesome! Is there any documentation showing that the parameters have to be in that order?

1 vote

I'm assuming that the null can also be a moduleUri?

I was only just trying to do this last night and kept getting "ArtifactRef is not a constructor" errors so will be trying this out this morning!

 Davyd,


Yes null can be a moduleURI. I found it when I started debuging IBM library. This code works because I am using this in my appications.


 Jake,


Display any existing artifactRef and You will see the order of the parameters. I was not able to find any documentation and this is outcode of my own research.

Bartek

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
× 7,495
× 1,325

Question asked: May 17 '21, 4:33 p.m.

Question was seen: 857 times

Last updated: May 18 '21, 6:07 a.m.

Confirmation Cancel Confirm