It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to copy Epic "Parent Link to Story Custom Field Edited

PM I'm New Here Sep 10, 2019

Hi all,

I'm having much difficulty finding solution tips for Jira Cloud.

My objective is to get the Parent Link value from Epic to copy to story custom field.

Parent Link field is provided by Jira Portfolio.

I am using Script Listeners configured to fire on the *Issue Updated event.

Script:'Fetch fields for selected issue')
def issueKey = 'TT-1' // Story

def customFields = get("/rest/api/2/field")
.findAll { (it as Map).custom } as List<Map>

def Parent_Link = customFields.find { == 'Parent Link'}?.id 
def issue = get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')

def Testfield = issue.body.fields[Parent_Link] as String

def result = put("/rest/api/2/issue/${issueKey}")
//.queryString("overrideScreenSecurity", Boolean.TRUE)
.header('Content-Type', 'application/json')
fields: [
(Parent_Link): Testfield
if (result.status == 204) {
return 'Success'
} else {
return "${result.status}: ${result.body}"

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

236 views 1 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you