Forums

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

Restrict issue creation with certain symbols

Phil Evans
January 21, 2021

Hi.

I want to restrict creation of issues from portal with certain symbols in Summary and Description.

I can put Simple Scripted Validator on workflow creation with

!issue.summary.value.contains("«") && !issue.summary.value.contains("»")

and it works, but how do i use this restriction only for portal request issues creation?

Or please advise how can i use this in Behaviours?

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 12, 2020

You can probaby tweak https://library.adaptavist.com/entity/calculate-the-working-days-between-two-dates a little bit to get it out.

Personally, I'd do it as a "scripted field"

Angie Affolter
Contributor
June 12, 2020

forgive me, I've never done a scripted field, but is what you're saying different from the script Ravi and you mentioned?  Don't I create the 'answer' as a custom scripted field and then attach the script or are there multiple ways we're talking about?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 12, 2020

Nothing to forgive, it's a perfectly good follow up question, especially as I've made a mistake!

The script we've pointed at is indeed for a scripted field.  I only glanced at the top bit of it to confirm it was code you might find useful, and assumed it was a post-function that set another field.  It's not, you should indeed paste it into a scripted field definition.

Note that when you create the scripted field, you probably want to set its "searcher" to "number range" and then when you're putting the script in, set the "template" to "number"

0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 12, 2020

Hi @Angie Affolter 

Take a look at this script here to get started.

Ravi

TAGS
AUG Leaders

Atlassian Community Events