Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Validator to check comment length Scriptrunner

Thais Sales Monteiro de Sousa January 10, 2024

Hi everyone,

 

I'm trying to create a transition validator for jira cloud with jira expressions that can check not only if a comment was left but also the length of that comment

Can someone help?

I came up with the following but it does not work

issue.comments
.filter(comment => comment.id == null)
.map(c => c.body.plainText)
.filter(text => text.length > 10)
.length > 0

1 answer

1 accepted

1 vote
Answer accepted
Thais Sales Monteiro de Sousa January 10, 2024

My expression was correct guys. It works

arno
Contributor
June 4, 2024

Hi @Thais Sales Monteiro de Sousa 

    I try to use the code you provided and run it on the jira server. The system prompts "unexpected token: >", can you help me to find out how to optimize it, thank you

Thais Sales Monteiro de Sousa June 4, 2024

Hi arno, this validator works for Jira Cloud.

I'm not familiar with Jira Server to say if it works the same way

Suggest an answer

Log in or Sign up to answer