Forums

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

Is there a way to disable the class cache in ScriptRunner

Steffen Stamprath
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.
December 9, 2020

Is there a way to disable the class cache in ScriptRunner?

I have the problem that I keep working on classes (separate files). But they are cached and then they are outdated at runtime (e.g. in the console).

My scenario:
test.groovy (for console) uses e.g. UserManager.groovy
Every time I change UserManager.groovy I have to clear the whole cache. This is stupid.

 

Are there some solutions here? Alà:
- Cache update if groovy file changed
- Clear cache for single file?
- ...?

Thanks a lot!

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Kevin Johnson
Community Champion
August 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

Raleigh
September 10, 2020

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 Champion
September 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.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events