How to copy linked issue id to custom field.

Gsep Support May 25, 2016

We have a customer request as below.

 

We have a custom filed naming 'Linked Issue Id'. Whenever i link any user story to to current issue the custom field 'linked issue id' should get updated automatically with linked user story ID.

1 answer

0 votes
Doug Swartz
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.
May 25, 2016

If you have the ScriptRunner plugin, you could write a scripted field which looks at the links and returns the ID value.

You could write a plugin. The challenge is that there are no events which are triggered when a link is added. Thus, you will probably have to do something like what the scripted field does, and look at the links each time your field is requested.

We took a slightly different approach and created a plugin with a "linked" field type. When an issue Id is entered in the custom field, the plugin automatically adds a link to the issue. You could do the same thing with a ScriptRunner scripted listener

 I mention ScriptRunner, because that's where I have experience. I believe you could take similar approaches with another plugin, such as Kepler JJupin or custom fields.

Gsep Support May 25, 2016

@Doug Swartz Thanks for your answer.

I am planning to use scripted field. Could you please help me providing the script which i have write for copying linked issue to custom field.

Gsep Support May 30, 2016

Hello @Doug Swartz, 

Did you get a chance to take a look on the request.

 

Thank you so much in advance!

Doug Swartz
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.
May 31, 2016

I'm sorry, I don't have time to write and test a script for you. Take a look at the https://answers.atlassian.com/questions/12276114

it has sample to code to do something very similar to what you're asking for.

 

Doug

Suggest an answer

Log in or Sign up to answer