Problems creating a customizded sub-task action.

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

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

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

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

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

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

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

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

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?

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

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted yesterday in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

40 views 0 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you