How to get URL of the current server dynamically in the dojo script?
Hello All,
We have a dojo script setup in IBM ELM to calculate a URL and it is configured in the process template under workitems. But the calculate URL has server URL hardcoded and we are getting the ID of the workitem dynamically. We want to get even the Server URL dynamically in the dojo script.
Reason:
Currently while cloning data from production to quality server the dojo script is copied with production link since the URL is hard coded.
Any code sample on how to get the server URL dynamically in dojo script of IBM ELM - would be helpful.
Thanks in advance!
Currently while cloning data from production to quality server the dojo script is copied with production link since the URL is hard coded.
Any code sample on how to get the server URL dynamically in dojo script of IBM ELM - would be helpful.
Thanks in advance!
3 answers
Hello Akilesh,
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.