I would like to transform the text inputed into a scritped field to be transformed into a hyperlink based on what is inputed.
So far I have,
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.CustomFieldManager CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); document_id = customFieldManager.getCustomFieldObjectByName('Document_ID'); //return the full href: DOCUMENT_ID = issue.getCustomFieldValue(document_id); return '<a href="http://server:port/object/Issue/' + DOCUMENT_ID + '">' + DOCUMENT_ID + '</a>'
This does not work, however.
Hello Brian.
We are happy to take your question here. We ran your script on our test servers and we see it working fine. You have not given us your output, so we do not know what part does not work.
We guessed that maybe you are not setting the scripted field template as a HTML, but as plain text. If you set your script like you see in the picture below:
It should work as you intend.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Even though Scriptrunner is a plugin, since you are working on some code, I wager the Developer Community will be of more help:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.