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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,032
Community Members
 
Community Events
176
Community Groups

Parent link custom field is not showing summary of parent key in .csv file

Hi Community,

Is there any possibility that parent link custom field shows the summary of parent key as well with parent key while exporting it into .csv format. however it is showing summary as well in .html format.

2 answers

2 votes

Hi @Naman Jain 

Not natively, in a CSV file it only includes the "Parent Link" issue key.

There's other options though - for example...

  • Create a custom field - "Parent - Summary", and then use Automation to populate it (Automation is native to Jira DC v9).
  • If you have a scripting App (like Scriptrunner), use it to create a scripted field which populates with the "Parent - Summary"

Once the metadata is available for the child issues in your search, you could then add the field as a column and export it via CSV :)

Ste

@Naman Jain 

 

We accomplished this with a ScriptRunner Listener that fires on Issue Created and Updated Events. Probably needs to fine tuning as it's kind of overkill, but this should work for you. 

Our custom field variables are named portParentLinkKey & portParentLinkSummary. You should be able to grab the Summary of your Parent Link issue and populate it in another field using this code. 

I'm on Jira DC - 8.20

 

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.issue.CustomFieldManager

import com.atlassian.jira.issue.MutableIssue

import com.atlassian.jira.issue.Issue

import com.atlassian.jira.issue.util.DefaultIssueChangeHolder

import com.atlassian.jira.issue.ModifiedValue

import com.atlassian.jira.issue.index.IssueIndexingService

//the issue that was created, ie. any jira issue that is created

def issue = event.issue as MutableIssue

//the Component Accessor class provides static methods for accessing JIRA's managed components

def customFieldManager = ComponentAccessor.getCustomFieldManager()

def issueManager = ComponentAccessor.getIssueManager()

def portParentLinkKey = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName("Portfolio Parent Link Key")[0]

def portParentLinkSummary = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName("Portfolio Parent Link Summary")[0]

def changeHolder = new DefaultIssueChangeHolder()

def issueIndexManager = ComponentAccessor.getComponent(IssueIndexingService)

//access the Parent Link Field

def parentLink = customFieldManager.getCustomFieldObjectsByName("Parent Link")[0]

//the value of the Parent Link field

def parentLinkValue = issue.getCustomFieldValue(parentLink) as String

//if the parent link field is empty, exit the script

if (parentLinkValue == null) {

    log.debug "Parent link is null: Exit script"

    return

} else {

    log.debug "Parent Link field's value = " + parentLinkValue

   

    def parentIssue = issueManager.getIssueByCurrentKey(parentLinkValue)  

    def key = parentIssue.getKey()

    def summary = parentIssue.getSummary();

   

    log.debug("Parent Link Key = " + parentLinkValue + " Parent Issue Summary: " + summary + " Parent Issue Key = " + key)

                   

    portParentLinkSummary.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(portParentLinkSummary),summary),changeHolder)            

    portParentLinkKey.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(portParentLinkKey),key),changeHolder)

 

    issueIndexManager.reIndex(issue)    

}

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events