Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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 use custom fields in connect's jiraWorkflowValidators module Edited

Use case

I'm trying to do a connect workflow validator following this documentation Custom fields are available according to this other documentation.

Issue

My app installation fails (error msg: "An error occurred during installation. Contact the app vendor for support.") when using this expression in the app descriptor:

"expression": "issue.resolution.name == 'Done' && issue.customfield_10077 != null"

 Questions

  • Can custom fields be used in expressions in the jiraWorkflowValidators module
  • If so, which one is the right syntax to test for a custom field not to be empty

1 answer

1 accepted

0 votes
Answer accepted
Darryl Lee Community Leader Apr 29, 2021

Hi Javier - are you developing your own Jira application (add-on/plug-in?)? Cool!

One of my favorite apps for testing Jira Expressions is Jodocus's Expression Tester.

You could use it to validate your expression. The correct syntax for determining if a field is "empty" is: !!issue.customfield_10077

So I might try:

"issue.resolution.name == 'Done' && !!issue.customfield_10077"

Let us know how it goes.

By the way, if you're not trying to build your own application that includes a workflow validator, then to use Jira Expressions for that, you'll need to use an add-on:

Thanks Darryl for your tips!

I simplified my expression to focus in the custom field. I installed Expression Tester and tested my expression syntax, which went through, see below.

My installation is however still throwing error.

This is the jiraWorkflowValidators entry in my descriptor

"jiraWorkflowValidators": [{
"key": "workflow-validator-edf",
"name": {
"value": "Early Detection Phase mandatory validation"
},
"description": {
"value": "Early Detection Phase fields should be mandatory when resolution is fixed"
},
"errorMessage": {
"expression": "'Early Detection Phase can not be empty when Resolution is fixed'"
},
"expression": "!issue.customfield_10077"
}]

If I change expression to "expression": "issue.resolution.name == 'Done'"  as below the app installs (and runs) correctly

"jiraWorkflowValidators": [{
"key": "workflow-validator-edf",
"name": {
"value": "Early Detection Phase mandatory validation"
},
"description": {
"value": "Early Detection Phase fields should be mandatory when resolution is fixed"
},
"errorMessage": {
"expression": "'Early Detection Phase can not be empty when Resolution is fixed'"
},
"expression": "issue.resolution.name == 'Done'"
}]

Any suggestions....?

Thanks!

Expression Tester:

evaluator.png

Installation error

installation.png

Darryl Lee Community Leader May 01, 2021

Alas, unfortunately development of add-ons is beyond my experience. You might try registering and asking in the Developer Community. This forum is specifically devoted to Jira Cloud:

https://community.developer.atlassian.com/c/jira/jira-cloud/7

Good luck!

I didn't now about the forum you mention.Thanks Darryl!

Atlassian support provided me with the logs of my app installation. It was not very clear what the problem was, but entries made reference to uninstalling the app because of an issue in another module I had in the same descriptor, a module that we've had deployed for months. After separating jiraWorkflowValidators into another descriptor if worked well with the original expression

"expression": "issue.resolution.name == 'Done' && issue.customfield_10077 != null"

go figure.

 

@Darryl Lee , thanks again for your help

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Why everyone using Jira must be GDPR-compliant

Did you know that penalties up to 4 % of the yearly company turnover are possible in case of GDPR violations? GDPR regulations are currently mainly relevant for companies in the EU, but countries lik...

100 views 1 3
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