Hiding and setting default value of a custom field Behaviour


Aim: Use a Behaviour to set a default value for a custom field on the Create Screen, but hide it from all roles bar Administrator until a specific point in the workflow. The field needs to be populated at Create (with dummy placeholder text) otherwise the field won't exist on the issue for later population/edit via REST. 

If a non-admin user creates the issue the field doesn't appear (correct), but when an admin user later views the issue the field isn't shown. I definitely have the Administrator role, but the behaviour logs suggest otherwise...even specifying my username in the except condition does not work.

Any assistance would be much appreciated. Thanks

Log :

2017-06-13 11:58:40,552 http-nio-8070-exec-13 DEBUG tdartford 718x11120x1 15gmqqg /secure/AjaxIssueEditAction!default.jspa [c.o.jira.groovy.Behaviour] action must be: 21
2017-06-13 11:58:40,553 http-nio-8070-exec-13 DEBUG tdartford 718x11120x1 15gmqqg /secure/AjaxIssueEditAction!default.jspa [c.o.jira.groovy.Behaviour] must be in role: 10002
2017-06-13 11:58:40,553 http-nio-8070-exec-13 DEBUG tdartford 718x11120x1 15gmqqg /secure/AjaxIssueEditAction!default.jspa [c.o.jira.groovy.Behaviour] user tdartford(tdartford) must be in role Administrators




1 answer

Hola Carlos David

The fact that you have administration permissions does not mean that you are in the group "Administrators". Your group might have administration permissions but that doesn't mean that you are in THAT group. I would advice you to take a look at which groups you are part of, maybe modify the script so that only the "developers" see it, and see if that works.

Let me know if that doesn't help.


Daniel Yelamos 

Hi Daniel, thanks for getting back to me.

I've simplified the conditions, using a specific user condition, in an attempt to sort this problem out. 

1. Creator is tcar (works)

Create screen: Field shown, autopopuated with the default value.

View screen: displayed for tcar, hidden for other users

2. Creator is another user

Create screen: Field not shown, log output shows that the field is populated behind the scenes however with the default value.

View Screen: Hidden for other user **and for tcar** despite the except condition shown below.


Any ideas?







Hey Carlos David.

I want to demo this and see if I get the same behaviour as you do. Can you give me your scriptrunner and jira versions please?



Jira Core 7.3.1

Script Runner 5.0.4




Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

362 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you