Auto-generated field in JIRA

Daniil Pavlyuchkov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 30, 2012

Hello, we use JIRA as a bug-tracking system. When we resolve an issue the fix is deployed to test environment and gets a domain that looks like http://key-523.site.com where key-523 is JIRA issue number.

How can I setup JIRA to have auto-generated fields that contains only a link to the test domain based on the issue number? It would greatly speed-up our testing process if we can click a link and go to testing environemnt rather than manually type it everytime.

Thank you in advance.

3 answers

1 accepted

1 vote
Answer accepted
Florin Manaila
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2012

You can use the SIL Script Custom Field available with this plugin. This is a calculated custom field using a simple scripting language. The code would look like this:

if(resolution == "<insert_your_"fixed"_resolution>"){
    return "http://"+ key + ".jira.com";
}

You can also return wiki-style text and use the Wiki renderer to make it clickable.

1 vote
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2012

Install Jamie's Script Runner plugin and use the custom field Scripted Field that comes with it. Use a simple script to get issue.key and build and html string that includes the href link, and probably target="_blank" to open the link in a new window.

https://studio.plugins.atlassian.com/wiki/display/GRV/Scripted+Fields

Daniil Pavlyuchkov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 28, 2012

Went with teh SIL plugin because you cannot update custom fields in the workflow. But at least I got that working - thanks.

0 votes
Ullink October 2, 2012

My best guess would be to write a small custom plugins:

  1. create a customfield of type 'URL', make it only viewable in your screens.
  2. create a custom post-function in JIRA that will simply update this field with value "http://" + issue.getKey()+ ".site.com"
  3. Add this post-function into your resolve transition.

But that requires write a postfunction, not that easy if you have never done that before (see https://developer.atlassian.com/display/JIRADEV/Workflow+Plugin+Modules#WorkflowPluginModules-Functions )

Suggest an answer

Log in or Sign up to answer