Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ScriptRunner Behaviors: Set comment visibility (commentLevel) Edited

Hi all,

I'm trying to set default comment visibility with ScriptRunner Behaviors.

SRJIRA-2545 says that it's possible with the following script:

def formField = getFieldById("commentLevel")
formField.setFormValue("role:10011")

So I tried it: for the comment field for a specific project (all issue types in it):
SR.png


without success (this is the issue view screen, tried refreshing cache with Ctrl+Shift+R):

Screenshot_1.png

 

Here are the roles that I have, I marked the role ID so that there's no doubt I used the right one in the script:

 

Screenshot_2.png

 

What am I doing wrong? (it's in a Jira Service Desk project)

Environment:

JIRA Service Desk 3.11.0 (Jira 7.8.0)
ScriptRunner 5.3.9
Tried on:
Google Chrome 65.0.3325.181
Firefox 59.0.2

1 answer

I'm having the exact same issue.   I've got code as an initializer without a field and decided to try your approach as well to add it to the Comment field.  Adaptavist responded to a ticket I raised indicating that a bug was fixed in version 5.3.9.  Since you're on 5.3.9, I would think you'd be fine.  (my system has an issue and I can't get from 5.3.26 to 5.3.9 so I'm still working on it myself)

I  will suggest you try putting the code in as an initializer alone as I reviewed debug log messages I made and it looks like they were never hit when expressed as a server script for the Comment field.  Could be wrong, though.

Discovered something that I wasn't aware of.  The defaulting is only working on the Edit screen of an issue and not the Browse screen of the issue.  I now recall that Behaviors are only meant for the Edit screen, but hopefully Adaptavist may have some other guidance.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

266 views 7 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you