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.
Hi @Naman Jain
Not natively, in a CSV file it only includes the "Parent Link" issue key.
There's other options though - for example...
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
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)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.