Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-26470

Cron expression check bug

    XMLWordPrintable

Details

    Description

      When creating a new subscription for a filter, add a job with the following cron expression:

      0 0 * * * ? * 2,3,4,5,6
      

      The job can be successfully created (as in the screenshot creation.png), but when we edit, it throw a system error(detail in the file cron_error) like :

      Cause:
      java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6
      
      Stack Trace: [hide]
      
      java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6
      at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseCronString(CronExpressionParser.java:322)
      at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseAndValidateCronString(CronExpressionParser.java:305)
      at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.<init>(CronExpressionParser.java:75)
      at com.atlassian.jira.web.action.filter.FilterSubscription.doDefault(FilterSubscription.java:107)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      

      It looks like the Cron expression will only check the first 6 components, if they're OK, the job can be create even the expression is illegal for example:

       
      0 0 * * * ? * 2,3,4,5,6 8
      0 0 * * * ? * 2,3,4,5,6 8 11 21
      ....
      

      The only workaround solution is to delete the job.

      Attachments

        1. creation.png
          creation.png
          68 kB
        2. cron_error.txt
          27 kB

        Activity

          People

            Unassigned Unassigned
            yilinmo Yilin (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: