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

Automation for Jira "Scheduled" Action does not run Scriptrunner Script unless at least 1 Issue is parsed to the action via JQL

    XMLWordPrintableJSON

Details

    • 0.8

    Description

      Users who use the Automation for Jira "Scheduled" Action to Execute a ScriptRunner script will find that the script contents never get executed unless they parse at least 1 issue to the script execution action.

      You may see log entries showing the script being compiled but it will not actually run without at least 1 issue.

      Workaround

      The issue parsed does not have to be used in the script so currently, the workaround is to just parse 1 issue to the script via the "simply run the conditions and actions without providing issues" option

       

      To reproduce:

      Define a Global automation for Jira rule to execute a Scriptrunner Script as follows:

       

       Save the rule and then you can use the "Run Now" button to trigger it

       

      If you turn scriptrunners debug logging on you will see this in the logs when you do not provide an issue to the script action:

      2019-03-04 11:39:36,015 http-nio-8080-exec-9 DEBUG admin 699x347x1 wqoto9 172.17.0.1 /rest/cb-automation/latest/project/GLOBAL/rule/6/execute [c.o.j.groovy.groovyrunner.spring] BeforeInstantiation [bean=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction, type=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction]
      2019-03-04 11:39:36,018 http-nio-8080-exec-9 DEBUG admin 699x347x1 wqoto9 172.17.0.1 /rest/cb-automation/latest/project/GLOBAL/rule/6/execute [c.o.j.groovy.groovyrunner.spring] AfterInitialisation [bean=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction, type=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction]
      2019-03-04 11:39:36,024 http-nio-8080-exec-9 DEBUG admin 699x347x1 wqoto9 172.17.0.1 /rest/cb-automation/latest/project/GLOBAL/rule/6/execute [c.o.j.groovy.groovyrunner.spring] BeforeInstantiation [bean=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction, type=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction]
      2019-03-04 11:39:36,026 http-nio-8080-exec-9 DEBUG admin 699x347x1 wqoto9 172.17.0.1 /rest/cb-automation/latest/project/GLOBAL/rule/6/execute [c.o.j.groovy.groovyrunner.spring] AfterInitialisation [bean=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction, type=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction]
      2019-03-04 11:39:36,040 http-nio-8080-exec-9 DEBUG admin 699x347x1 wqoto9 172.17.0.1 /rest/cb-automation/latest/project/GLOBAL/rule/6/execute [c.o.j.groovy.groovyrunner.spring] BeforeInstantiation [bean=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction, type=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction]
      2019-03-04 11:39:36,042 http-nio-8080-exec-9 DEBUG admin 699x347x1 wqoto9 172.17.0.1 /rest/cb-automation/latest/project/GLOBAL/rule/6/execute [c.o.j.groovy.groovyrunner.spring] AfterInitialisation [bean=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction, type=com.onresolve.scriptrunner.automation.ExecuteScriptIssueAction]
      

       

      If you then provide an issue to the script action you will see this additional line:

      2019-03-04 11:47:39,085 http-nio-8080-exec-10 DEBUG admin 707x568x1 wqoto9 172.17.0.1 /rest/cb-automation/latest/project/GLOBAL/rule/6/execute [c.o.scriptrunner.runner.ScriptRunnerImpl] Test log from script Automation 4 Jira

       

      There is actually a warning about this when you choose to not parse an issue to the script:

      But as Users will most likely want to run Scripts without parsing an Issue, we need an easily identifiable way to use this integration without parsing an issue.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mclark Matthew Clark
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: