Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-1010

Cannot customise proposed issue types using behaviours

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.3.4, 4.2.0.2
    • Fix Version/s: 5.4.38
    • Component/s: None
    • Labels:
    • Environment:

      JIRA v7.0.2
      JIRA v6.4.1

    • Sprint:
      Sprint 40, Sprint 41, Sprint 42, Sprint 43
    • Critical Points:
      3.4

      Description

      Right now, it's not possible to limit the issue types available on the create/edit issue screens using behaviours the way you can with priorities.

      From user's report:
      Trying to hide some Issue Types using Behaviors, but not able to make it to work.
      Here is the snippet that I'm trying (script added to Issue Type field in behavior as well as Initialiser), and I've verified the mapping as well:

      import com.atlassian.jira.component.ComponentAccessor
      import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
      
      def issuevalue = getFieldById("issuetype")
      log.warn("The Current Issue Type ID is " + issuevalue.getValue())
      log.warn "IT:" + issuevalue
      def constantsManager = ComponentAccessor.getConstantsManager()
      def allowedIssueTypes = constantsManager.getAllIssueTypeObjects().findAll
      { it.name in ["Bug", "Request"] }
      .collectEntries{
      [(it.id)]}
      log.warn "Issue Types: " + allowedIssueTypes 
      getFieldById("issuetype").setFieldOptions(allowedIssueTypes)
      

        Attachments

          Issue Links

            Structure

              Activity

                People

                Assignee:
                tbatagiannis Thanos Batagiannis
                Reporter:
                tbatagiannis Thanos Batagiannis
                Votes:
                26 Vote for this issue
                Watchers:
                38 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Structure Helper Panel