Problems creating a customizded sub-task action.

Begoña Bonet February 24, 2015

Hi,

My scenario:

1.- I've created two issuetype REQUISITO and SUB-REQUISITO. Both with the same flow. SUB-REQUITISO has been created as sub-task.
2.- I need to create a Sub-task issue which issuetype is SUB-REQUISITO.
3.- Instead to use "Create sub-task" action provided by JIRA, I've decided to create an specify transition in the flow. The reason: It'll appear in the Flow actions menu and also I need to manage with it.

My solution (it doesn't works :-():

1.- I've defined a new transaction named "Añadir Sub-requisito".
2.- I've defined the following post-funcions:

 AnyadirSubrequisito_Postfunciones.png

3.- As you can see in the following images, it doesn't work because the customfield "Código del sub-requisito" in parent issue isn't copied in customfield "Código del requisito" in child issue.

 

AnyadirSubrequisito_PantallaParametros.png

 

AnyadirSubrequisito_VistaSubrequisito.png

What can I do?

8 answers

0 votes
Fidel Castro
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.
March 2, 2015

It shouldn't have anything to do with the problem. Obviously I don't have that particular issue type you have created in your customized instance of JIRA.

Anyway, workflow and other configurations associated with your SUB-REQUISITO issue type might have something to do.

It would be interesting doing the following test: change post-function configurations in order to make them work with "Sub-task" instead of "SUB-REQUISITO". This way we will be able to discard that issue type has something to do with the problem.

0 votes
Begoña Bonet March 1, 2015

I've launched this transaction interactilvey. I've found one difference: My issue type in point 5 and 6 (creating a subtast and populate customfields) is SUB-REQUISITO, not Sub-task. Could it be the reason?

AnyadirSubrequisito_Subrequisito_definicion.png

0 votes
Fidel Castro
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.
March 1, 2015

I have tried with Kepler Custom Field 2.6.5 and 2 Regular Expression custom fields, Script Runner 2.1.16, JIRA 6.1.7 and JIRA Workflow Toolbox 2.1.26 and it's working correctly, i.e., parent's "Código del sub-requisito" is copied to subtask's "Código del requisito".

I have tried to reproduce your configuration as faithful as possible:

Captura de pantalla 2015-03-02 a las 10.25.18.png

Another question: Are you executing your transition interactively (by a user) or by any other means?

0 votes
Begoña Bonet February 26, 2015

Hi Fidel,

I'm working with Script Runner 2.1.16

For both fields "Código del requisitio" y "Código del sub-requisito" I'm using Regular Expression Custom Field type (with kepler Customfield plugin v.2.6.5)


Begoña

0 votes
Fidel Castro
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.
February 26, 2015

I have tried with JIRA 6.1.7, JIRA Workflow Toolbox 2.1.26 and Script Runner 2.1.16, trying to copy custom fields of types Number and Text 255, and in both cases it worked correctly, and it also worked if I set the 2 post-functions before the reindexing post-function (at 1er and 2th position in execution order indeed).

  1. Which version of Script Runner are you using?
  2. Which types are both custom fields you are working with ("Código del sub-requisito" and "Código del requisito")?

Fidel

0 votes
Fidel Castro
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.
February 25, 2015

Hi Begoña,

I have tried to reproduce your problem using JIRA 6.3.15 and JIRA Workflow Toolbox 2.1.28, and your configuration works flawlessly.

Can you please tell me which version of JIRA and the plugin are you using, in order to reproduce your problem?

Best regards,

Fidel

Begoña Bonet February 26, 2015

Hi Fidel, I'm trying with: Workflow Toolkit Plugin 2.1.26 Jira 6.1.7 Thanks in advance! Begoña

0 votes
Begoña Bonet February 24, 2015

I've tried but it doesn't work. 

In log I've found:

 

[atlassian.event.internal.AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event 'com.atlassian.jira.event.issue.IssueEvent@245f3288[issue=REQ-38,comment=<null>,worklog=<null>,changelog=<null>,eventTypeId=1,sendMail=true,params={eventsource=workflow, baseurl=http://jira-dsa.gva.es},subtasksUpdated=false]' from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.onresolve.jira.groovy.listener.ScriptRunnerUberListener.workflowEvent(com.atlassian.jira.event.issue.IssueEvent), listener=com.onresolve.jira.groovy.listener.ScriptRunnerUberListener@4db9be56}'.
java.lang.RuntimeException: Cannot invoke method startsWith() on null object
0 votes
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 24, 2015

Hi,

Have you tried moving those  2 postfunction before the reindex?

or doing a second reindex after the creation of the subtask?

It might have something to do with that.

Best regards,

Peter

Begoña Bonet February 24, 2015

I've put the 2 transactions before reindexing action but it doesn't work. In log I've found: [atlassian.event.internal.AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event 'com.atlassian.jira.event.issue.IssueEvent@245f3288[issue=REQ-38,comment=<null>,worklog=<null>,changelog=<null>,eventTypeId=1,sendMail=true,params={eventsource=workflow, baseurl=http://jira-dsa.gva.es},subtasksUpdated=false]' from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.onresolve.jira.groovy.listener.ScriptRunnerUberListener.workflowEvent(com.atlassian.jira.event.issue.IssueEvent), listener=com.onresolve.jira.groovy.listener.ScriptRunnerUberListener@4db9be56}'. java.lang.RuntimeException: Cannot invoke method startsWith() on null object

Suggest an answer

Log in or Sign up to answer