Jira List View Q1.png
I have to add a column in the Jira Issue List view programatically. Or I want to append data to the "Summary" column?.
Hi Vishnu,
did you try die Column Button in the right upper corner?
2016-04-12 11_30_38.png
There you can search for additional fields and add them to the view.
You can even define new fields - please refer to this official documentation.
Hope this helps, Cheers, Mario
Hi Mario,
Thanks for the reply.
I want to know, Is there a way to add this programatically using the JIRA Java APIs?
Yes, you could, but DO NOT DO IT. At best it's a waste of your coding time for almost zero benefit, at worst, it'll just annoy your users.
The columns you see are flexible and chosen by the user. There are three places JIRA looks when choosing columns
Sorry, I didn't get that. But unfortunately I cannot give an answer on that. Maybe by doing a javascript post with a customfield_id.
Edit: Thanks Nic!
@Nic Brough -Adaptavist-
While asking this same question in a slightly different context I came up with a nifty solution that should be useful to many. Now that Nic works at Adaptavist I hope you can confirm this is the best way to do it.
Problem:
I used ScriptRunner to generate a list of all issues that have a 'depends on' relationship. The only columns that I could add to show those 'depends on' issue keys was the "Links." However, that shows all linked issues regardless if the type was 'depends on,' 'blocks,' 'blocked by,' 'relates to,' etc. There is no simple way to show "Depends on" as a column.
JQL:
"Clarity Project Name" in ("xxxx") AND issueFunction in hasLinks("depends on")
Note: "Clarity Project Name" is a Custom Field in our Jira.
Solution:
Use ScriptRunner to create a "Scripted Field" called "Depends On", see:
https://scriptrunner.adaptavist.com/5.0.4/jira/scripted-fields.html
Note: Docs are a bit confusing, but essential
import com.atlassian.jira.component.ComponentAccessor;/* import org.apache.log4j.Loggerimport org.apache.log4j.Leveldef log = Logger.getLogger("com.acme.CreateSubtask")log.setLevel(Level.DEBUG)*/import com.atlassian.jira.component.ComponentAccessordef browseurl = com.atlassian.jira.component.ComponentAccessor.getApplicationProperties().getString("jira.baseurl")+"/browse/"def issueLinkManager = ComponentAccessor.getIssueLinkManager()def inlinks = issueLinkManager.getInwardLinks(issue.getId())//log.debug(inlinks.size())def keymap = [:]issueLinkManager.getInwardLinks(issue.getId()).each { issueLink -> if(issueLink.getIssueLinkType().getInward() == "depends on"){ def ikey = issueLink.getSourceObject().getKey(); //log.debug("iter: "+ikey) keymap[ikey]="<a href=\""+browseurl+ikey+"\" >"+ikey+"</a>"; }}def sortedmap = keymap.sort{a, b -> def (akey,aval) = a.key.split("-") def (bkey,bval) = b.key.split("-") if (akey == bkey) return aval as int <=> bval as int; return akey <=> bkey;}def keylist = []sortedmap.each{k,v -> keylist.add(v)}return keylist.join(", ")
Now "Depends On" field is available in the filter view so that you can show only the "Depends On" links. Not sure why, why Depends On links only show as inward links, and alot of places on the net shows that they should appear on Outward links!?
It looks like you're new here. Sign in or register to get started.