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

How to dynamically get the workitem url?

Hello,

I'm trying to get the url of a work item using the attribute customization (Calculated Values). However, I'm not able to get it with my dojo script. I'm basically trying to return the window.location.toString() to an HTML attribute created.
I'm able to print in my console the value of window.location.href but the same thing is not returned. The attribute is empty. 
In a nutshell, I'm trying to fetch the entire url of a workitem in RTC dynamically. I don't have any details such as the workitem ID, base URL, hostname etc.,

Can someone please help me out here?

0 votes



One answer

Permanent link

Can you explain your actual end goal in detail? It sounds like you're going about things in a very complicated way and there may be a much more straightforward way to achieve this.

0 votes

Comments

I agree with Davyd. The API is documented here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization I summarized what I know here: https://rsjazz.wordpress.com/2022/11/25/ewm-attribute-customization-introduction/

You can access the ID of the work item, given that, you can create the URI of the work item It looks like: https://server:port/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12345 for the work item with ID 12345.

To be precise, I want my end result to be a URL which looks exactly like this: https://server:port/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/12345


For this, I'm trying to write a dojo script in the Calculated Values. I have created an attribute of type HTML and added an editor presentation for the same (type: HTML). Now, I want to populate this attribute's value from the calculated values dynamically. At this point, I don't have the workitem ID or the server details with me. I want to somehow fetch all these details of the workitem in some way to get the entire workitem url. Would this be possible to achieve with dojo scripts?

What i asked was what is your goal, not what is the immediate thing you're trying to do. Why do you want this URL? What are you going to do with it?

The calculated script is for populating an attribute with a value - are you trying to populate it with a link? Because most of the attributes are protected and you won't be able to create a clickable link.

I ask again - what is your actual final goal in doing this?

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
× 12,019

Question asked: Sep 11, 2:16 a.m.

Question was seen: 459 times

Last updated: Sep 13, 3:16 a.m.

Confirmation Cancel Confirm