Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Does issue.epic.summary work for Tasks in Team Managed Software Projects?

Rasneet Kanwar
September 22, 2023

Hi, we've set up automation to copy Epic Summary into a custom text field "EN". The rule is working fine for the Company Managed projects but is returning "None" for the Team Manged Project for the Task type of Issues.... Here's what we are using:

1. When: Issue Created

2. If matches: Issue Type equals Subtask

2.1 Then: Edit issue fields - Set EN as {{issue.parent.epic.summary}} ---- Works fine on Company and Team Managed Projects.

3. Else - If matches: Issue Type is one of : Task, Bug, Story

3.1 Then: Edit issue fields - Set EN as {{issue.epic.summary}} ----- Works fine on Company Managed Projects but returns "None" for Team Managed Projects.

I have also tried to use parent instead of epic but that also returns "None". Please advise.

 

2 answers

1 vote
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 3, 2014

It's telling what the problem is, you're calling a method on *customfield* which you have not defined.

Use:

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObject(12345)
def num = issue.getCustomFieldValue(cf)

Gnanasakthi C
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!
August 21, 2018

Dear, Am using below script and facing the issue. Please assist..

 

import jxl.*;
import java.io.*;

def testdatafile= "F:\\TestData.xls"; 
log.info(testdatafile)

Workbook work= Workbook.getWorkbook(new File(testdatafile))
Sheet sheet1=work.getSheet("Sheet1")

def Base= (sheet1.getCell(0,0).getContents())
def Accoount= (sheet1.getCell(0,1).getContents())

log.info(Base)
log.info(Account)
log.info(Base1)
log.info(Account1)

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 3, 2014

Hi Ilka,

Thank you for your question.

I would kindly suggest you on trying the following:

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.security.groups.GroupManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.crowd.embedded.api.User
import com.atlassian.crowd.embedded.api.Group
import com.atlassian.jira.util.SimpleErrorCollection

GroupManager groupManager = ComponentManager.getComponentInstanceOfType(GroupManager.class)

CustomFieldManager cfManager = ComponentManager.getInstance().getCustomFieldManager()
CustomField cf = cfManager.getCustomFieldObject(10005)
Object customFieldValue = issue.getCustomFieldValue(cf)

System.out.println(customFieldValue);

Kind regards,
Rafael

Suggest an answer

Log in or Sign up to answer