Forums

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

Find a field based on custom field ID not by name

Jeremy Schrecengost
Contributor
April 9, 2018

Hello,

I am creating a Adaptavist Groovy Listener and I have everything working but I want to change it to use the customfield id or by passing in "customfield_19419" instead of "My Variable Name" is that possible? 

 

I just do not want to update the code if another admin decides to change the name of the field. 

 

 

def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "My Variable Name"}

 

1 answer

0 votes
Michael Wolfe
Community Champion
June 6, 2018

I don't have any experience with Adaptavist Groovy Listener, but with Automation for Jira, we could only use the customfield ID.  Have you already tried it, and it not work?  The syntax we used to reference the customfield was issue.fields.customfield_10603.

Suggest an answer

Log in or Sign up to answer