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

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

Change issuetype/project after overwriting default security level with behaviours (scriptrunner)

We have one project (project A), where we like to have different default security levels for different issue types.

I created a script to overwrite the default value at the create issue screen. So far, so good.

Now I have seen, that when I change the issue type or the project at the create issue screen, the level will be transferred to the new issue type or project, if the security level is present on the create issue screen of this issue type or project.

If I look at other projects I see the following behavior without scriptrunner.

Project B has default level _open_.

When I switch to project C with default level normal, the level on the create issue screen switches as expected from open to normal.

How can I achieve this behavior with scriptrunner?

Would you recommend to overwrite the security level in a post function instead?

1 answer

1 accepted

1 vote
Answer accepted

@Erik Buchholz 

Instead of unnecessary battles with behaviors, lets make our lives easier; firstly, you don't need to have the security level(system field) on the create screen since to be honest most users don't care about this field as they don't know who is limited(group/user/roles) in the issue security setting apart from JIRA admin/Project admin, i would even remove it from screen.I suggest you do it silently with script runner post function in the create transition for the workflow

  •  Go to post-functions > Add post function > Script Post-Function > Add
  •  Choose the Set issue security level depending on provided condition
  •  In the Condition below
    issue.issueType.name == 'A'
  • Choose the security level and Update.
  • You can add more than one post function to threat different cases. if workflows are shared among several projects you can add this to the condition
      issue.issueType.name == 'A' && issue.projectObject.key == 'ET'

 

Kind regards,

Moses.

Dear Moses,

thanks for your reply.

You're completely right. Most users don't care about the security level. That's the reason, we need good defaults.

I'd like to give the few users who care the chance to change this at creation but that's not necessary.

I will give others the chance to reply before accepting your answer.

Kind regards,

Erik

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

249 views 2 5
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