Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Show issue links via Velocity processed Message Custom Field (for view)

Sergey Papurin
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.
January 30, 2012

Is it possible via velocity custom field using javascript or jquery display issue links to current issue?

2 answers

1 accepted

1 vote
Answer accepted
Sergey Papurin
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.
January 31, 2012

Here the code for Velocity custom field (for view):

#set ($issueLinkManager = $jirautils.loadComponent('com.atlassian.jira.issue.link.DefaultIssueLinkManager', $customField.getClass()))
#set ($outlinks = $issueLinkManager.getOutwardLinks($issue.id))
#foreach ($outlink in $outlinks)
$outlink.destinationObject.key
$outlink.destinationObject.summary
<br>
#end
0 votes
JamieA
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.
January 30, 2012

Do you mean the incoming links? These should be displayed anyway.

I just released a version of the script runner that lets you use groovy to write the values for custom fields, there is a vaguely similar example to what it sounds like you want here: https://studio.plugins.atlassian.com/wiki/display/GRV/Scripted%20Fields#ScriptedFields-Aninformationmessage

Sergey Papurin
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.
January 31, 2012

Here the code for Velocity custom field (for view):

#set ($issueLinkManager = $jirautils.loadComponent('com.atlassian.jira.issue.link.DefaultIssueLinkManager', $customField.getClass()))
#set ($outlinks = $issueLinkManager.getOutwardLinks($issue.id))
#foreach ($outlink in $outlinks)
$outlink.destinationObject.key
$outlink.destinationObject.summary
<br>
#end

stevegore September 24, 2015

Actually this won't work for most users.. Replace $customField.getClass() with $issue.getClass()

Suggest an answer

Log in or Sign up to answer