Hi,
I want to set a link as a Message custom field value in Jira. So i want to get the value of a custom field in this script. How can i get it as an html script.
Thanks
Shilpa
Hi Shilpa,
With HTML script I assume you mean javascript?You could use javascript to fetch the custom field value via the REST API of Jira. But if I'm not mistaken custom JS does not work properly anymore in more recent version of Jira. I haven't tried it in a while.
Is there any reason you need to do this in a message custom field? Because I'd rather use a scripted field with scriptrunner. Of course that app is not free.
Hello Misonne,
Am trying a html script for adding a default value for a Custom Message Field. eg would be like this:
if(document.getElementById("customfield_11370-val") != 'undefined' && document.getElementById("customfield_11370-val") != null){var key = JIRA.Issue.getIssueKey();var htmlVar = "<a target=\"_blank\" href=\'"+"http://example.com/"+key+"'>"+"http://example.com/+key+"</a>";document.getElementById("incDiv").innerHTML = htmlVar;}
Here am taking Jira issue key value like wise i need to fetch a customfield value.
Hi @Shilpa Sanil,
I worked with javascripts long back, not in recent days. you can try out ".value" or below code to fetch value of custom field or any other field(s)
target = document.getElementById('customfield_10000');target.value
Hope this helps
Regards,
Leo
Ok I haven't used that method myself. I think you should look into what @Leo replied.
It looks like you're new here. Sign in or register to get started.