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?
2 answers
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.
Comments
Hello Vindhya,
If you mean you want to get the server url importantly https://<server> part try to fetch it from the creator attribute of the workitem.
workItem.getAttribute(WorkItemAttributes.CREATOR).getNullValue().webUri
Then you can match the part you require from the url related to creator details and filter hostname, baseurl or server key.