Hi,
I created a Fast-track Post Function that verifies if there are any attachments on the Issue and if there aren't, it transitions the issue, this is what I have on the
I tried with both conditions below but I had the same error.
021-06-08 16:55:42.661 ERROR - Cannot get property 'length' on null object on line 1
condition:issue.fields.attachments.length == 0
condition:issue.attachments.lenght == 0
Any suggestions?
By the way, issue.attachments.lenght is valid on the Expression Tester App.
Daniel
I change it and it keeps showing the error:
2021-06-08 16:55:42.661 ERROR - Cannot get property 'length' on null object on line 1 2021-06-08 16:55:42.675 ERROR - Class: com.adaptavist.sr.cloud.workflow.FastTrackIssue, Config: [className:com.adaptavist.sr.cloud.workflow.FastTrackIssue, uuid:71369c1f-0147-4c52-b5de-899a697c2046, enabled:true, executionUser:ADD_ON, condition:issue.attachments.length == 0, description:, additionalCode:, comment:Attachment is mandatory, please review, transitionId:101, transitionName:Back to Hiring Manager, accountId:XXXX]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also tried with a filter option that actually works on the Expression Tester but on the fast-track condition doesn't:
021-06-09 12:58:10.292 ERROR - startup failed: Script1.groovy: 1: unexpected token: > @ line 1, column 38. issue.attachments.filter(attachment => attachment.mimeType == 'application/pdf').length > 0 ^ 1 error 2021-06-09 12:58:10.309 ERROR - Class: com.adaptavist.sr.cloud.workflow.FastTrackIssue, Config: [className:com.adaptavist.sr.cloud.workflow.FastTrackIssue, uuid:71369c1f-0147-4c52-b5de-899a697c2046, enabled:true, executionUser:ADD_ON, condition:issue.attachments.filter(attachment => attachment.mimeType == 'application/pdf').length > 0, description:, additionalCode: , comment:Attachment is mandatory, please review, transitionId:101, transitionName:Back to Hiring Manager, accountId:XXXX]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Daniel Alonso I just tested it and if validator does not pass, email notification comes to my email inbox with message:
And my validator looks like:
Do you have similar configuration?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Martin Bayer _MoroSystems_ s_r_o__
I cannot use a regular SR validator, or even a jira workflow validator/condition because I want to block an approval transition and right now it is not being blocked, even with a built-in validation/condition. That's why I used the Fast-track transition to catch if the issue doesn't have any attachment go back to the approval status.
Can you please try on your end using a Fast-track transition, then you will see what I'm talking about.
Thanks, Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.