Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to create advanced scripted field to display the story points value from the link issue to epic?

Prerna Prerna
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!
November 21, 2018
I want to create a Scripted Field that contains information ( story points, issue key and status) from the issues that have been linked to epic. And display then in HTML Table. I did find a script: import com.atlassian.jira.component.ComponentAccessor
import groovy.xml.MarkupBuilder

def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def links = issueLinkManager.getOutwardLinks(issue.id)

def writer = new StringWriter()
def xml = new MarkupBuilder(writer)


if(!links){
return null
}

xml.style(type:"text/css",
'''
#scriptField, #scriptField *{
border: 1px solid black;
}

#scriptField{
border-collapse: collapse;
}
''')

xml.table(id:"scriptField"){
tr{
th( "Key")
th("Sorty Points")
th("Status")
}
links.each {issueLink ->
def linkedIssue = issueLink.destinationObject
tr{
td(linkedIssue.key.toString())
td(linkedIssue.storypoints.toString())
td(linkedIssue.status.getName().toString())
}
}
}

return (writer.toString())

Which works fine for giving the details for (issue key and status), but I am not able to get the story points value in this and setting a jql to get only open linked issue value, not the closed one.

I am new to scripting, any help will be much appreciated.

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Prerna Prerna
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!
November 23, 2018

Any help, is much appreciated. 

Tanu January 21, 2022

@Prerna  you are using wrong spellings.

th("Sorty Points") its wrong.

TAGS
AUG Leaders

Atlassian Community Events