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