Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Workflow "create" differences between various workflows causing problems with script listeners

Scott Harman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2012

Hi guys

I created a workflow for our incident management based on the example on the Jira webpages, and with a little bit of tweaking - it worked fine.

I'm now trying to use a script listener to fire a custom email if anyone from our staff creates a Critical or Blocker incident, it will notify key users

The difference between the official Jira helpdesk workflow, and our 'normal workflow' is as following:

Jira Helpdesk workflow::
<post-functions>
        <function type="class">
          <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueCreateFunction</arg>
        </function>
        <function type="class">
          <arg name="class.name">com.atlassian.jira.workflow.function.issue.UpdateIssueStatusFunction</arg>
        </function>
        <function type="class">
          <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueStoreFunction</arg>
        </function>
        <function type="class">
          <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg>
        </function>
        <function type="class">
          <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg>
          <arg name="eventTypeId">1</arg>
        </function>
      </post-functions>

Our Normal workflow:
          <post-functions>
            <function type="class">
              <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueCreateFunction</arg>
            </function>
            <function type="class">
              <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg>
            </function>
            <function type="class">
              <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg>
              <arg name="eventTypeId">13</arg>
            </function>
          </post-functions>

The listener thows the following error when a regular user calls it:

2012-08-03 02:56:04,042 http-80-11 WARN sman 176x47342x1 1gihx2a 10.54.1.234 /browse/INC-2115 [jira.issue.transitions.TransitionLinkFactory] !!! Issue INC-2115 has no workflow ID !!! 
2012-08-03 02:56:04,042 http-80-11 DEBUG sman 176x47342x1 1gihx2a 10.54.1.234 /browse/INC-2115 [onresolve.jira.groovy.GroovyCustomField] debug: 65170

Do you guys think the extra workflow steps are causing the issue to occur?

Any issue created by an external user throws the error - and it has only started occurring since the new listener was added

Many thanks

Scott

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Scott Harman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2012

I rewrote the workflow to be a regular set of post-functions like my standard workflow, and this allowed the custom fields to be set an updated at the right point. The issue was having the regular post function separately to the global post functions as defined in the workflow.

0 votes
Scott Harman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2012

Dammit...

Well the answer is one line above the workflow step I think

<results>
        <unconditional-result old-status="null" status="open" step="17">
          <post-functions>
            <function type="class">
              <arg name="field">customfield_10361</arg>
              <arg name="user.property.key">Group</arg>
              <arg name="class.name">com.innovalog.jmwe.plugins.functions.SetFieldFromUserPropFunction</arg>
            </function>
          </post-functions>
        </unconditional-result>
      </results>
      <post-functions>

I've got a post function that we use with all external users, to set the CC Group field as part of the create process. This seems to be buggering up the listener event.

Will see if I can fix this myself, but might have to come back for more help.

TAGS
AUG Leaders

Atlassian Community Events