Disable issue creation via GUI

Issue #180 resolved
Adolfo Casari created an issue

Hi Fidel,

After upgrading to Jira 6.4 I found Atlassian changed the way they implement selectcombos (dropdowns), so something I was handling via Jquery before I am not able now: remove issue types options in the Create dialog. So my scenario now is:

When I create issuetype X in its postfunction I create N different issues types and link them to issue X.

I need to disable creating any of those N issuetypes via GUI, since they are only meant to be created programatically as explained above.

Do you see any alternative using JWT?

Comments (5)

  1. Fidel Castro Armario repo owner

    Hi Adolfo,

    Unfortunately, JIRA Workflow Toolbox doesn't allow to restrict the values in issue types dropdown list.

    Anyway, you can implement a kind of workaround adding a validation to "Create Issue" transition in the workflows of those issue types you need to restrict creation via GUI. You can allow creation via GUI only to certain project roles (e.g., Administrators), or under special circumstances (fields values, issue links, etc.), and prevent creation in the rest of the cases, making the validation fail. Here you have some examples.

    The problem of this solution is that the user will be shown the issue creation form, and will fill it, only to realize that he can't create the issue after clicking the submit button.

    Regards,

    Fidel

  2. Adolfo Casari reporter

    In Jira can you check whether an action comes from the GUI or not? In my case I create those N issuetypes using a Scriptrunner postfunction. And this should be the only way to create these issue types. If I add a validation in the WKF of these types like the ones you suggest, I would need to check this condition, otherwise scriptrunner postfunction would fail to create too.

    The idea is that those issue types must belong to a structure, so they must not be allowed to be created like any other issue in Jira.

  3. Fidel Castro Armario repo owner

    Adolfo,

    I think that it should be possible to do it, but I think that, before doing any other thing, it's convenient to investigate whether there is a validation in Script Runner to check whether an action is being carried out by Script Runner, i.e., something similar to isJwtTriggeredTransition() in Jira Workflow Toolbox.

  4. Adolfo Casari reporter

    It's very unlikely. That postfunction is implemented as a groovy script using Jira Java API.

    I have just found a way in Jquery to use the current implementation for the comboboxes, so I can continue to tweak the GUI.

    Yet it woud be great that you could include in future versions a "Create and Link Issues" postfunction. With this, I could add a validation (isJwtTriggeredTransition() ) in those issues that I need to disable GUI creation.

    Thanks for your support.

  5. Log in to comment