Hello Everyone,
I am not sure if this is possable but is there a way to add a new column to the Issues in Epic panel on epics. I am hoping there is some configuration setting somewhere like subtask.
Thank you in advance.
Don't think this option is avaialble at the moment. Editing the add-on would be the only way now i think.
Put this into announcement banner (remember the change the custom field id in the script):
<script type='text/javascript'> AJS.$(document).ready(function() { AJS.$('#ghx-issues-in-epic-table tr').each(function(){ console.log('Found epic table'); var row = this; var issueKey = AJS.$(this).attr("data-issuekey"); AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function(data){ console.log('Got data for - ' + issueKey); var value = data.fields.customfield_10600; console.log('Value - ' + value); var actions = AJS.$(row).find('td.issue_actions'); AJS.$(actions).before('<td class="nav">' + value + '</td>'); }); }); }); </script>
Thanks for sharing this Renjith!
I'm trying to add fixVersions value to the table and struggle to address this filed properly.
data.fields.fixVersions returns object type, how can I get version(s) names?
fixVersions is an Array. Use this:
<script type='text/javascript'> AJS.$(document).ready(function() { AJS.$('#ghx-issues-in-epic-table tr').each(function(){ var row = this; var issueKey = AJS.$(this).attr("data-issuekey"); AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function(data){ var value = data.fields.fixVersions.map(function(version){return version.name}); var actions = AJS.$(row).find('td.issue_actions'); AJS.$(actions).before('<td class="nav">' + value + '</td>'); }); }); }); </script>
That's very useful and a good example of how to change what is show. It will need testing for each version of Agile since the DOM model changes reasonably quickly between versions in my experience.
Hi Renjith
How do you add multiple custom fields as columns in "Issues in Epic" panel?
Is it:var value = data.fields.customfield_10600, data.fields.customfield_10601;
Many thanks.
Hi - Can someone tell me exactly where I enter these details
Thanks
The best approach is to loop over the fields.
console.log('Got data for - ' + issueKey); var actions = AJS.$(row).find('td.issue_actions'); var index; var fields = [data.fields.customfield_10600, data.fields.customfield_10601,data.fields.customfield_10602]; var addToTable = ""; for (index = 0; index < fields.length; ++index) { var field = fields[index]; if (!field) { field = ""; } addToTable += '<td class="nav" style="white-space: nowrap">' + field + '</td>'; } AJS.$(actions).before(addToTable);
Administration > System > User Interface > Announcement Banner - it has to stay there as long as you want to add extra column/s.
Hi Renjith,
I added a cloumn do display labels. Is there any way to move the column position from last to third (after issue key and summary)?
Thanks,Lukasz
Why doesn't all me to 'set banner'?
It would be nice to be able to configure Issues in Epic like sub-tasks.
Can you configure this to only display the issues in a specific project and not all epics?
This javascript snippet helped us too, because we wanted to see sprint data on this table.
However extracting sprint name is not easy as some already mentioned.
So I decided to solve this via string manipulation after converting "data.fields.customfield_10004" to a string.
My code is as follows:
<script type='text/javascript'> AJS.$(document).ready(function() { AJS.$('#ghx-issues-in-epic-table tr').each(function(){ console.log('Found epic table'); var row = this; var issueKey = AJS.$(this).attr("data-issuekey"); AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function(data){ console.log('Got data for - ' + issueKey); var value = "No Sprint" ; if (data.fields.customfield_10004 != null) { value = String(data.fields.customfield_10004); var re = /name/; var pos = value.search(re); value = value.substring(pos); var re2 = /,/; var pos2 = value.search(re2); value = value.substring(5,pos2); } console.log('Value - ' + value); var actions = AJS.$(row).find('td.issue_actions'); AJS.$(actions).before('<td class="nav">' + value + '</td>'); }); }); }); </script>
Hope that helps.
Hi,
I found a very good input here for my issues here. But while getting into the more into the details for my solution one question regarding issuetype arose:
I would like to check in such a script the type of issuetype to proceed with different actions depending on the issuetype. But somehow I don't get back the issuetype. Here's my script:
<script type='text/javascript'>AJS.$(document).ready(function() {AJS.$('#ghx-issues-in-epic-table tr').each(function(){console.log('Found epic table');var row = this;var issueKey = AJS.$(this).attr("data-issuekey");string1 =issueKey + " ";if (string1.startsWith("PSUMBRELLA")) { AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function(data){console.log('Got data for - ' + issueKey);var value1 = '- ' + data.fields.components.map(function(component){return component.name})+ ' -';var value2 = data.fields.fixVersions.map(function(fixVersion){return fixVersion.name})+ ' - ';var value3 = 'RemainingEffort: ' + (data.fields.aggregatetimeestimate)/3600 + 'h - ';var value4 = 'IssueType: ' + (data.fields.issueType.name))+ ' - ';console.log('Value - ' + value1 );console.log('Value - ' + value2 );console.log('Value - ' + value3 );console.log('Value - ' + value4 );var actions = AJS.$(row).find('td.issue_actions');AJS.$(actions).before('<font color="red"><td class="nav">' + value1 + '</td></font>');AJS.$(actions).before('<td class="nav">' + value2 + value3 + value4 +'</td>');});}});});</script>
Marked the area which I am struggling with in bold letters.
thanks for feedback
Best regards
Tobias
Lukasz Baksik I don't see "ANNOUNCEMENT BANNER" in Jira Cloud.
User Interface is present in System but even if i search for the word Banner or Announcement, nothing turns up. I have gone through the menus many times, nowhere can I fin Announcement Banner in Jira Cloud.
Can you please clarify?
Kind Regards.
Why isn't this available in the advanced settings as for sub-tasks?
In our Jira the announcement banner is used for other purposes and putting a js script that certainly not all admins would understand is a really bad practice as from my perspective.
Can the same thing be done in some add-ons? Maybe Behaviours?
I totally agree.
Adding a script to the annoucementbanner cannt be the solution as you have to potentially develop, test and fix it after every update.
So there really is no "clean" solution?
Hello Lukasz,
The insertion is done with the line
AJS.$(actions).before('<td class="nav value">' + value + '</td>');
The line before that set the action
var actions = ALS.$(row).find('td.issue_actions');
Looking at the web page in the developer console, F12, you will see that td.issue_actions is the last table data column. Replacing td.issue_actions with the appropriate column will change the position. E.g. use td.issutype to place it between the summary and the issuetype icon.
var actions = ALS.$(row).find('td.issuetype');AJS.$(actions).before('<td class="nav value">' + value + '</td>');
BrHenrik
Hi
Do you know how to replace there column "Stage" to "Sprint". Because sprint number is more useful?
https://take.ms/4rnrt
Hello everybody,
It was important to me to show the sprints in the epic as well as the versions.
The key is to call up the correct REST endpoint.
Here is the corresponding code:
<script type='text/javascript'> // https://community.atlassian.com/t5/Jira-questions/How-do-you-add-a-column-to-quot-Issues-in-Epic-quot-panel/qaq-p/292561 AJS.$(document).ready(function() { AJS.$('#ghx-issues-in-epic-table tr').each(function(){ var row = this; var issueKey = AJS.$(this).attr("data-issuekey"); AJS.$.getJSON(AJS.contextPath() + '/rest/agile/1.0/issue/' + issueKey, function(data){ //console.log(data); var actions = AJS.$(row).find('td.issue_actions'); sprintinfo = "" if (data.fields) { if (data.fields.sprint) { sprintinfo = "<b>" + data.fields.sprint.name + "</b><br/>" } if (data.fields.closedSprints && Array.isArray(data.fields.closedSprints)) { sprintinfo = sprintinfo + "<i>" for (i = 0; i < data.fields.closedSprints.length; i++) { if (i > 0 ) sprintinfo = sprintinfo + "<br/>" sprintinfo = sprintinfo + data.fields.closedSprints[i].name } sprintinfo = sprintinfo + "</i>" } } AJS.$(actions).before('<td class="nav">' + sprintinfo + '</td>'); var version = data.fields.fixVersions.map(function(version){return version.name}); AJS.$(actions).before('<td class="nav">' + version + '</td>'); }); }); }); </script>
Best,Marco
See my last post
Folks, Here is my simple script to display latest sprint in Issues in Epic panel. You need a custom field id for latest sprint.
<!-- Script to add latest Sprint column in Issues in Epic panel --><script type='text/javascript'>AJS.$(document).ready(function() {AJS.$('#ghx-issues-in-epic-table tr').each(function(){console.log('Found epic table');var row = this;var issueKey = AJS.$(this).attr("data-issuekey");AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function(data){console.log('Got data for - ' + issueKey);var value = "" ;if (data.fields.customfield_25380 != null) {value = String(data.fields.customfield_25380)};console.log('Value - ' + value);var actions = AJS.$(row).find('td.issue_actions');AJS.$(actions).before('<td class="nav">' + value + '</td>');});});});</script>
cc: @RenjithA
I am posting answer for priority name for issues in epics. Use below code in announcement banner
<script type='text/javascript'>AJS.$(document).ready(function() {AJS.$('#ghx-issues-in-epic-table tr').each(function(){var row = this;var issueKey = AJS.$(this).attr("data-issuekey");AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function(data){var value = data.fields.priority.name;console.log('Got priority column value:- ' + value);var actions = AJS.$(row).find('td.issue_actions');AJS.$(actions).before('<td class="nav">' + value + '</td>');});});});</script>
Thanks.
Hm, this script isn't giving me the priority icon. Is this possibly due to me being on server?
Hi @Heather R
Below code should work and will give the priority name. The icon somehow is not working for me now , i am also on server
@Deepali Bagul That is so helpful!! Thank you! I'm getting the text of the priority. You wouldn't happen to know how to tweak this to get the priority icon, would you?
Hi,You can try with the plugin https://marketplace.atlassian.com/apps/1221267/smart-panels-for-jira?hosting=server&tab=overview maybe it can helpCheers,
I see this is an older thread, but I'm having the same issue. We need to display fix version in the Epic Link and Issue Link section. Neither of these are working. Any suggestions would be greatly appreciated.
@Renjith Pillai The code doesn't work on Jira 9.12.2 - Any way to make it work for issues in epics for that version? I was trying with a story points custom field
Meanwhile on Jira's Jira:
https://jira.atlassian.com/browse/JSWSERVER-14565
https://jira.atlassian.com/browse/JRACLOUD-70206
It looks like you're new here. Sign in or register to get started.