Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

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

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?

 

 

2 answers

1 accepted

3 votes
Answer accepted
Fabian Lim Community Leader Nov 06, 2021

Hi @Hendrik Dimter

Welcome to the community.

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

Regards

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 Nov 06, 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

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 Nov 08, 2021

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

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 Nov 08, 2021

Great!

Open a query in Design view,Right-click the box where you want to insert your expression, and then choose Build. If you're creating a calculated field, then you need to right-click the Field box,Add or edit the expression,Click OK.

 

LiteBlue

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

797 views 5 13
Read article

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