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

sr-trigger-flag class doesn't trigger flags on web item provider fragments

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Won't Fix
    • Affects Version/s: 5.3.7
    • Fix Version/s: None
    • Component/s: Fragments
    • Labels:
      None
    • Critical Points:
      0.7

      Description

      To reproduce:

      • Create a Custom web item provider:
        • What section should this go in:
          operations-subtasks.

        • Key: whatever you want.

        • Provider class/script:

          import com.atlassian.jira.project.Project 
          import com.atlassian.plugin.web.api.model.WebFragmentBuilder
          
          def fragments = [] 
          [1,2].each { 
          
              fragments << new WebFragmentBuilder(1) 
                  .id("create-subtask-type-ReinstatementRequired") 
                  .label("Subtask number ${it}") 
                  .title("Subtask number ${it}") 
                  .styleClass("sr-trigger-flag") 
                  .webItem("") 
                  .url("/rest/scriptrunner/latest/custom/createSubtask") 
                  .build() 
          } 
          
          return fragments
      • Create a REST endpoint:
        • Inline script:

          import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate 
          import groovy.json.JsonOutput 
          import groovy.transform.BaseScript 
          
          import javax.ws.rs.core.MultivaluedMap 
          import javax.ws.rs.core.Response 
          
          @BaseScript CustomEndpointDelegate delegate 
          
          createSubtask(httpMethod: "GET") { MultivaluedMap queryParams -> 
          
              def flag = [ 
                  type : 'success', 
                  title: "Subtask created", 
                  close: 'auto', 
                  body : "Succesfully created!" 
              ] 
              return Response.ok(JsonOutput.toJson(flag)).build() 
          }
      • Go to any issue, click on the 'More' drop-down and click on either of 'Subtask number 1/2'.

      Expected behaviour (as seen in 5.3.2-rc5): a success flag pops up on the current page.

      Actual behaviour (as seen in latest [91f83a0]): the user is taken to the REST endpoint URL, where they see the JSON configuration of the flag.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jchoules Joanna Choules
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: