I would like to add a custom field named "Case" that will be a hyperlink
as follow "Case" <number> as http://mwz/<case Number>
the user will be able to add only case number
the field will be http://mwz/ + <case Number>
like
(System prompt -->)Case: 680103097 (<-- user input)
The user should not be able even accidentally to change the prefix(i.e. http://mwz/).
and will be shown as
Case: http://mwz/680103097 in any JIRA screen
Hi Alexander,
I have posted below a code example which shows how you could use a scripted field provided by the Script Runner plugin to take the Case Number out of a number field which stores the Case Number and the to display it in a scripted field called Case which displays the URL. You could always make the Case Number field mandatory which would then mean that you would not need the else clause in the code below.
When setting up the scripted field the must be set to 'HTML' in order to make the returned hyperlink clickable.
// Get the Case Number def caseNumber = getCustomFieldValue("Case Number") // Check if a case number exists and if so construct and set the Case URL if (caseNumber != null){ def baseURL ="http://mwz/" // Construct the HTML hyperlink tag to be returned. def caseURL = "<a href=" + baseURL + caseNumber.toLong() +">" + baseURL + caseNumber.toLong() + "</a>" return caseURL // If no case number exists return a warning message. }else{ return "No current case exits" }
I hope this helps.
Many Thanks
Kristian
It's kind of strange that Atlassian never implemented this as an out-of-the-box feature. I've had use cases that would benefit from this since 2005...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would use a simple scripted validator from Script Runner with a regular expression:
cfValues["Case"] ==~ "http://mwz/[\d+]"
(untested)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie, I do not have experience in this field. The idea is very attractive. I would be very grateful for a detailed step-by-step guide or any links to similar subject. Thanks, Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexander,
you could defina a custom field of type "URL".
There you can set a default value, e.g. http://mwz/xxx"
Your users will only have to replace xxx with a number.
In the custom field configuration you can define a default value, here "Standardwert bearbeiten":
2015-11-16 16_33_40-Benutzerdefiniertes Feld konfigurieren_ URL.png
How to create custom fields, please refer here: documentation
Hope this helps.
Cheers,
Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.