Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×

Forums

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

Bypass behaviour field options limits in a post-function script as admin user

Stefano Alessandrini October 4, 2021

Hi, we set a behaviour script that limits the Issue type options to prevent specific users to create some kind of issues in a specific project just like this example:
https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/restricting-issue-types.html

Please note that in the behaviour I use its API (formField.setFieldOptions()) to limit the issue types.

 

I have a custom post-function script that clones the current issue in a selected project, but if they select that project, I get a forbidden exception due to the issue type behavior set limits.

I would like to be able to bypass this limit, in the script, forcing it somehow, but I've not access to behaviour API in the post-function.

Besides if I check available issue this way:

import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE

def issueTypeField = ComponentAccessor.getFieldManager().getField(ISSUE_TYPE)
lg.info("issueTypeField.getOptionsForIssue(issue, false)*.getName())

I get ALL issue types in schema, even the limited ones, so I can't even detect the case in the script...

Any idea?

 

Thanks, Stefano

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.13.0
TAGS
AUG Leaders

Atlassian Community Events