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

If priority is not present in an issue, get log errors about templates/email/html/includes/fields/priority.vm

    XMLWordPrintable

Details

    Description

      The HTML (not Text) velocity template to display the priority in a newly created issue (issuecreated.vm) doesn't handle the case where an issue's field configuration has hidden the priority. Below are the ugly errors that clutter up the log file and then a simple fix for this.

      2011-11-04 15:06:17,692 Sending mailitem com.atlassian.jira.mail.IssueMailQueueItem@536cfd7c[issue=com.atlassian.jira.issue.IssueImpl@251c086c[id=10904,summary=No prriority #1,key=TEST-15,created=2011-11-04 15:06:16.557,updated=2011-11-04 15:06:16.557,assignee=admin,reporter=admin],remoteUser=admin,notificationType=Current_Assignee,eventTypeId=1,templateId=1] ERROR ServiceRunner    Mail Queue Service [velocity] RHS of #set statement is null. Context will not be modified. templates/email/html/includes/fields/priority.vm [line 6, column 9]
      2011-11-04 15:06:18,053 Sending mailitem com.atlassian.jira.mail.IssueMailQueueItem@536cfd7c[issue=com.atlassian.jira.issue.IssueImpl@251c086c[id=10904,summary=No prriority #1,key=TEST-15,created=2011-11-04 15:06:16.557,updated=2011-11-04 15:06:16.557,assignee=admin,reporter=admin],remoteUser=admin,notificationType=Current_Assignee,eventTypeId=1,templateId=1] ERROR ServiceRunner    Mail Queue Service [velocity] Left side ($url.startsWith("http://")) of '==' operation has null value. If a reference, it may not be in the context. Operation not possible. templates/email/html/includes/fields/priority.vm [line 1, column 34]
      2011-11-04 15:06:18,324 Sending mailitem com.atlassian.jira.mail.IssueMailQueueItem@536cfd7c[issue=com.atlassian.jira.issue.IssueImpl@251c086c[id=10904,summary=No prriority #1,key=TEST-15,created=2011-11-04 15:06:16.557,updated=2011-11-04 15:06:16.557,assignee=admin,reporter=admin],remoteUser=admin,notificationType=Current_Assignee,eventTypeId=1,templateId=1] WARN ServiceRunner    Mail Queue Service [velocity] org.apache.velocity.runtime.exception.ReferenceException: reference : template = templates/email/html/includes/fields/priority.vm [line 1,column 1] : ${url} is not a valid reference.
      	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:277)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
      	at org.apache.velocity.runtime.parser.node.ASTStringLiteral.value(ASTStringLiteral.java:138)
      	at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:51)
      	at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:95)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:89)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
      	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:171)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
      	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:181)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:89)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
      	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:300)
      	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:202)
      	at com.atlassian.velocity.DefaultVelocityManager.getEncodedBodyForContent(DefaultVelocityManager.java:143)
      	at com.atlassian.jira.mail.MailingListCompiler$1.processRecipient(MailingListCompiler.java:296)
      	at com.atlassian.jira.mail.NotificationRecipientProcessor.process(NotificationRecipientProcessor.java:39)
      	at com.atlassian.jira.mail.MailingListCompiler.addMailsToQueue(MailingListCompiler.java:318)
      	at com.atlassian.jira.mail.MailingListCompiler.access$400(MailingListCompiler.java:42)
      	at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.addEmailsToQueue(MailingListCompiler.java:463)
      	at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendLists(MailingListCompiler.java:433)
      	at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendNoLevelsIgnoreGroup(MailingListCompiler.java:413)
      	at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendToAll(MailingListCompiler.java:408)
      	at com.atlassian.jira.mail.MailingListCompiler.sendLists(MailingListCompiler.java:140)
      	at com.atlassian.jira.mail.IssueMailQueueItem.send(IssueMailQueueItem.java:152)
      	at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:66)
      	at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:23)
      	at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:60)
      	at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:47)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
      	at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      

      and the fix for priority.vm

      #if ($issue.getPriorityObject())
      <tr valign="top">
          <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 10px 10px 0;white-space:nowrap;">
              <strong style="font-weight:normal;color:${textSubtleColour};">#text("issue.field.priority"):</strong>
          </td>
          <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
              #set ($priority = $issue.getPriorityObject())
              #renderIcon(${priority.iconUrlHtml} ${priority.getNameTranslation($i18n)})
              $textutils.htmlEncode(${priority.getNameTranslation($i18n)}, false)
          </td>
      </tr>
      #end
      

      Attachments

        Issue Links

          Activity

            People

              edalgliesh Eric Dalgliesh
              73d805a2526b MattS
              Votes:
              11 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: