It's all about the answers!

Ask a question

How to get the URL of a workitem ?


Arshad Adavani (231220) | asked Mar 17 '16, 6:09 a.m.
Hi all,

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


Thanks for any help.


Regards,
Arshad

Accepted answer


permanent link
anup Gaur (1392444) | answered Mar 17 '16, 7:44 a.m.
 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

Comments
Arshad Adavani commented Mar 17 '16, 7:49 a.m.

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


Arshad Adavani commented Mar 17 '16, 7:53 a.m.

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



anup Gaur commented Mar 17 '16, 7:57 a.m.

 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


Arshad Adavani commented Mar 17 '16, 8:02 a.m.

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


anup Gaur commented Mar 17 '16, 8:03 a.m.

 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
Ralph Schoon (63.3k33646) | answered Mar 17 '16, 6:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

Comments
Arshad Adavani commented Mar 17 '16, 7:44 a.m. | edited unknown

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 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.