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

How to retrieve RTC workitem ownedBy email address in Python

I am using the Python package rtclcient (v0.6.0) to get info from work item.
Some of the properties I am querying from my RTC work item include:
```
returned_properties_list = [
    "rtc_cm:modifiedBy",
    "dc:modified",
    
    "rtc_cm:ownedBy",
]
```

When the query for these items finish and I examine the returned variables, I notice that the 'ownedBy' value is the user's id, not their email address.
```
ownedBy: "320178017"
```

If I look at the value of `raw_data['rtc_cm:ownedBy']['@rdf:resource']` it is a link which goes to that user's profile. 

On the profile page I can see the User ID as well as the User's E-mail Address. This email address value is what I need, but I can't seem to find a way to query for this value using the rtcclient python package.

I've tried adding `"rtc_cm:emailAddress"` to my query properties but no luck,

Can anyone help me get the ownedBy user email address for a RTC ticket using the rtcclient package? I'm wondering if I can query or make an authenticated get request to the profile page, if i can just get the html contents or xml, i can extract the email address value. 

0 votes


Accepted answer

Permanent link

 I do not know the rtcclient tool, but the underlying mechanism is likely OSLC. I try to summarize OSLC and how it works in my blog e.g. in https://rsjazz.wordpress.com/2022/02/02/ewm-work-item-oslc-cm-api/ . I will not write all that again here in the answer. Fundamentally OSLC provides with access to resources by providing an URI. For the owner attribute the URI for the value in your case is https://rtcus1.ta.company.com/jts/users/320178017 . If you want more information about the user, you GET that URI and provide the required headers. You also need to be authenticated to JTS, because that hosts the URI. The image below shows this for an example user I have:





Ralph Schoon selected this answer as the correct answer

0 votes


One other answer

Permanent link

 solved by making a request to https://rtcus1.ta.company.com/ccm/oslc/users/320178017

0 votes

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
× 457
× 10
× 1

Question asked: Feb 28 '22, 12:53 p.m.

Question was seen: 1,673 times

Last updated: Mar 01 '22, 12:02 p.m.

Confirmation Cancel Confirm