Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,502
Community Members
 
Community Events
184
Community Groups

scriptrunner behaviours - not working - does anybody have simple sample/example?

Hi,

we're having trouble just trying simple behaviour example - not sure if we're missing something very obvious

for example, can we set up simple behavior (read-only) on a non-custom field?

we tried using "voting" field - and under behaviors just adding 'read-only' slider (on/off) - set to "on" - and picking 'voting' field

maybe 'voting' is a bad choice - since it looks like out of the box - voting maybe doesn't let the ticket creator change/click the 'vote for this issue' - but it's available in the field picker - so would guess this is ok

 

anyway - how to make a regular field "read-only" using behaviors feature of scriptrunner plugin? is server side code needed? the slider "read-only" would seem to mean when set to on - it would be able to do that without code? some other postings suggest needing to 'enable' all features of script runner plugin - but there doesn't appear to be such a button/widget? but we're probably doing something wrong...

 

thanks

1 answer

0 votes
Kevin Johnson
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 31, 2020

@new jira user As far as I have worked with Behaviours, It works in screens like Edit, Create, View, other transition screens, I have here made the Summary to be Read-only and it works perfectly.b1.PNGb2.PNG

I'm also facing issues. I want a custom field to be read-only except for those in a particular group.

I have ProjectX, Epic issue type in the Mappings section.

I have Optional, Readonly, Shown as you show in your screen shot.

I have a Condition:

  • Except
    • Current user in group (GROUPA, where I am the only member)

That should mean for ProjectX, for Epics (the only context for the custom field, too), the custom field MyID should be read only to everyone except me because I'm the only member of GROUPA.

People are still able to edit the field, though.

Kevin Johnson
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 10, 2020

Hi @Raleigh ,

Clearly your requirement and @new jira user are totally different. Here He asked only to make a system field to make it read-only based only with the help of Behaviours in Scriptrunner, and no server-side scripts are necessary for that. For your requirement as you stated above, you have to write a script that can get the info of the group members in the particular group as required, and then the condition should be set as if the current user is not a member of the given group then make it not-editable. Maybe this can help.

**Note: Only writing a condition in a script will work, it can be simply done via the UI part of Behaviours when our requirements have an exclusivity.

Cheers,

Kevin.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events