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
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:
Installation error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I didn't now about the forum you mention.Thanks Darryl!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.