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

How to get the URL of a workitem ?

Hi all,

I have access to an IWorkItem. How do I retrieve its URL ?


Thanks for any help.


Regards,
Arshad

0 votes


Accepted answer

Permanent link
 Hi Arshad,
is this something you are looking for?

IWorkItem workItem = (IWorkItem) auditable;
...
...
...
String pWorkItemURL = Location.namedLocation(workItem, getPublicRepositoryURL()).toAbsoluteUri().toString();
Arshad Adavani selected this answer as the correct answer

0 votes

Comments

HI Anup,
Thanks for your suggestion.
I have constructed the URL. But what format should I be following to make sure that only text is visible but not link?

I mean to say like this: My link
Only "My Link" should be visible and it carries google search link. In Jira it is achieved by writing the hyperlink as [My Link|https://www.google.com]. How do we do it in rtc ?



Regards,
Arshad

And what is the implemetation of getPublicRepositoryURL() ..?


 Hi Arshad, 


Depends on where you want to publish this link. If I were to send it in an html email, I would simply wrap this string with <a href=" ...../a>. 
Question is what are you trying to do with the link?

warm regards,
Anup Gaur

Hi Anup,

I want to add it in Summary and description field.
<a href..../> anchor tag doesn't work here.
Do you have any suggestions ?


Regards,
Arshad

 Arshad : And what is the implemetation of getPublicRepositoryURL() ..? 


This is an internal API implementation. 
I have no idea about it.     
:-)

but it works fine if you have the Iworkitem..


One other answer

Permanent link
Use the search function to find the work item using its ID. In some of the UI's there is an action/context menu to copy the URI of the item. So you have the URI.

You can construct (one of the URI forms) if you have the ID. It is on my system for a work item with ID 43:

https://clm.example.com:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/43

Replace the 43 at the end by your ID and make sure to replace the first part of the url (up to ccm) with the public UIR Root of your system.

If this does not answer your question, please ask a more precise question.

0 votes

Comments

HI Ralph,
Thanks for your suggestion.
I have constructed the URL. But what format should I be following to make sure that only text is visible but not link?

I mean to say like this: My link
Only "My Link" should be visible and it carries google search link. In Jira it is achieved by writing the hyperlink as [My Link|https://www.google.com]. How do we do it in rtc ?



Regards,
Arshad

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
× 1,221

Question asked: Mar 17 '16, 6:09 a.m.

Question was seen: 2,884 times

Last updated: Mar 17 '16, 8:03 a.m.

Confirmation Cancel Confirm