Missed Team ’24? Catch up on announcements here.

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

Synthax for an expression to get the value for a custom field

Hendrik Dimter November 6, 2021

I'm looking to fetch the value for a custom field variable, but my script keeps failing - I'm using the expression tester extension :-(

This is what I have:

issue.getAsString("customfield_10088")

 

In addition, I'm using this custom field across a project, not just a single issue. Would that change the above synthax?

 

 

1 answer

1 accepted

3 votes
Answer accepted
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 6, 2021

Hi @Hendrik Dimter

Welcome to the community.

What is the error you are getting and which scripting language are you using?

Regards

Hendrik Dimter November 6, 2021

Hi Fabian,

thank you for the Welcome!

I suppose this is javascript, I'm using this as a reference for my syntax:

https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference/

I wouldn't know one from the other to be honest (I'm not a developer).

I'm just trying to get Jira to fetch a custom field input value (for an email address) so I can use it within automation in order to send an email to that specific address.

Does that make sense?

Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 6, 2021

If you are using jira automation you need to use smart values. Here is the reference guide: https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/

{{issue.[Custom Field]}}

Regards

Like Hendrik Dimter likes this
Hendrik Dimter November 8, 2021

That works, thank you! I do have the challenge to reference this field project-wide, not issue-specific. I can't seem to f figure out how that would work - is that even possible?

Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2021

Customfield values apply to issues individually and are not project related. What is the value/field that you are looking for?  

Hendrik Dimter November 8, 2021

Hi Fabian,

I figured it out - there is no project declaration needed.

The below works within any issue automatically:

{{issue.customfield_10088}}

Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2021

Great!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events