Get UUID of a Project Area with id or name - using OSLC and SCM Command Line
3 answers
There are two approach options that I see:
- The EWM Plain Java Client Libraries. A lot of the code you wound need is in WCL - Note the link. You could extend it for your purpose or you grab the code you like.
- You se OSLC and you read up on it. If you want to start understanding how OSLC works, this might be an interesting source: https://rsjazz.wordpress.com/2021/09/29/using-the-ewm-rest-and-oslc-apis/
Just because you have that one URI does not mean that this URI would work in your case. You are not necessarily asked to compose such an URI based on an UUID and guessing the rest. OSLC in EWM has a discovery mechanism you are supposed to use. You need to be authenticated as well and that is not necessarily trivial, so if you want to go OSLC read up on how that works in https://rsjazz.wordpress.com/2021/09/29/using-the-ewm-rest-and-oslc-apis/ . The information is really useful. I wish I had it back then. I had to write it.
The EWM Plain Java Client Libraries are also explained in several posts on https://rsjazz.wordpress.com.
Comments
For the moment I am quering the project area list, after that I browse into it (with a basic for loop) quering for project areas details and if the name of the Project Area is corresponding to the name of the one I am searching for, I extract the UUID of this one.
I think it's not a really clean solution since the complexity is proportional with the number of PA but I didn't find another way to reach this goal.
I juste found that you can add to your SCM request "--show-uuid y" in the context of a "list [something]" in order to obtain the UUID of artefacts.
Something like "scm --show-uuid y list projectareas -r [url]" do the job.
After that, you just have to search into the resulting list to find by name the correct UUID.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Mar 27 '24, 7:05 a.m.Quentin Guyot
Mar 27 '24, 8:23 a.m.