It's all about the answers!

Ask a question

How to retrieve RTC workitem ownedBy email address in Python


David Adams (111) | asked Feb 28 '22, 12:53 p.m.
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. 

Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Mar 01 '22, 1:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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

One other answer



permanent link
David Adams (111) | answered Mar 01 '22, 12:02 p.m.

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.