It's all about the answers!

Ask a question

Get UUID of a Project Area with id or name - using OSLC and SCM Command Line


Quentin Guyot (1522) | asked Mar 27, 6:43 a.m.
Hi,
I am currently developping a tool that communicate with RTC using mainly SCM CL but since Workitems aren't supported by it, i am also looking into OSLC.

So, I need to find the UUID of a Project Area in order to make OSCL resquest on it, to find attached Work item.


Comments
Ralph Schoon commented Mar 27, 7:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Quentin,

It would be beneficial, if you would explain what the purpose of the tool is, and what the use cases/business cases are. 

  1. There are other APIs available that could be used.
  2. It might be possible to use tools such as WCL that uses the EWM Plain Java API
  3. If you are looking into OSLC, you have to follow how OSLC works. You will have to discover the project area URI using the OSLC discovery mechanisms
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/
 


Quentin Guyot commented Mar 27, 8:16 a.m. | edited Mar 27, 8:23 a.m.
I want to check in and deliver changes using SCM CL but for this I need to link work items to the change set. I would display a list of the project Area work items in order to let the user choose the Workitem associated with the change set he is created.

Since SCM CL doesn't support something like "list Workitems", I am plaining to use OSCL to get a Workitem list. I found that I can make a get request like "https://[my_url]/ccm/oslc/contexts/[UUID]/workitems?oslc_cm.pageSize=100&_startIndex=0" to find workitems base on the Project Area context ID ( UUID). But I don't have easy solution to get this UUID.

I am also currently testing the rtcclient library

now you have a little bit more context,
thanks


3 answers



permanent link
Ralph Schoon (63.5k33646) | answered Mar 27, 8:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 There are two approach options that I see:

  1. 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. 
  2. 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/ 
The plain Java client Libraries are easier to use from my perspective.

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
Ralph Schoon commented Mar 27, 9:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 In addition: here the APIS that are available: https://jazz.net/wiki/bin/view/Deployment/ELMProductAPILanding


The Reportable REST API is read only, so if you need to create a link to a change set, it is useless: https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#Reportable_REST_API

A last thought, make sure you can create the change set link. As far as I am aware, at least with the Plain Java Client Libraries, I was unable to create a change set link to a work item, because the Java API complained that this link could only be created by the SCM component. 

There might be some special save parameter or something that needs to be added for this to work.  


Quentin Guyot commented Mar 27, 9:28 a.m. | edited Mar 27, 9:33 a.m.

I forgot the point that I am not able to download Java on this pc, that's why I use only python for this project, and why OSLC might be the only solution to my problem here... I already read a big part of your post in wordpress about OSLC, but I have to admit that it's not trivial, It is still not that clear in my mind. But when you say "discovery" your talking about rootservices and services files, right ?

I was secretly hoping for an easy solution that I might have missed, but since it doesn't exist I'll go deeper into oslc.

Also, with SCM you can create a link between the change set and the Workitem if you specified the WI during the check-in command.

edit: You have in a better way also the command "add workitem" that associates a change set with a work item.


permanent link
Quentin Guyot (1522) | answered Mar 29, 10:30 a.m.

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.


permanent link
Quentin Guyot (1522) | answered Apr 02, 7:45 a.m.

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.

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.