Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

It is possible to have a post function in a workflow that creates an issue?

Ramiro Pointis
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 21, 2012

Can this be possible? Maybe be in Jira 5 or a plugin?

P.S. If it's a plugin must be compatible with Jira5.

4 answers

1 accepted

3 votes
Answer accepted
Miko Makela
Contributor
March 21, 2012
Nic Brough -Adaptavist-
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 21, 2012

You can write a post-function to do it as well, but the script-runner is probably going to be easier.

JamieA
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 21, 2012

See https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Clonesanissueandlinks - although it clones all the fields you can override any or all of them.

Ramiro Pointis
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 21, 2012

This is awesome! I'm trying this right now, but I have a problem... I don't know the syntax.

How it should be my condition if the issue should be issuetype 'Test Case' and the status changes to 'Execution Error'? Maybe like this:

issue.issueTypeObject.name == "Test Case" && issue.status.name == 'Execution Error'

And in Additional issue actions, I need to change the summary like this:

String oldsumary = issue.summary

issue.summary = 'Error Case - ' + oldsummary

Are these scripts well-written?

JamieA
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 21, 2012

Just from eyeballing them they look fine... do they not work?

Ramiro Pointis
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 21, 2012

No, it isn't working...

1- I entered in Scripts Listener menu

2- I selected Clones an issue and links

3- I selected event "issue update", all projects, tarjet project null, tarjet issue 'Error', issue link type 'related to'

4- Condition: issue.issueTypeObject.name == "Test Case" && issue.status.name == 'Execution Error'

5- additional actions: String oldsumary = issue.summary

issue.summary = 'Error Case - ' + oldsummary

Am I missing something? Maybe the condition script should be:

issue.issueType?.name == "Test Case" && issue.status.name == 'Execution Error' ?

Ramiro Pointis
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 21, 2012

Do I need to add the imports in those scripts?

JamieA
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 21, 2012

What that would do is, any time anyone edits an issue, a new Error issue will be created. I doubt this is what you want? One problem could be that Error is not in the issue type scheme for the project.

You need to check the log files... if there are problems with the condition it will show that.

No, no imports required.

Ramiro Pointis
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 21, 2012

Oh, I think I'm doing it the wrong way then. Basically my needs are, when an issue goes through the transition called 'Executed with errors', an issue type 'error' must be created related to the original issue 'Test Case'. How can I do this?

Ramiro Pointis
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 22, 2012

I found that the problem was the Error Workflow. As soon as I changed a few conditions there it worked fine.

Awesome plugin, highly recomended.

JamieA
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 22, 2012

Cool... sounds like you want a post-function on the transition rather than a listener then. And thanks ;-)

0 votes
Matthias Brenner June 12, 2014

Unfortunately Script Runner is not available for OnDemand Installation.

0 votes
Matthias Brenner June 12, 2014

Unfortunately Script Runner is not available for OnDemand Installation.

0 votes
Bradley Kyer
Contributor
March 21, 2012

I have done this by selecting the initial step name (New) then from the Workflow Browser on the right of the screen select the incoming transaction called "Create" (this is the initial transition in the workflow). From here you see the links for Validators and Post Functions. I have added some simple Post Functions like "The Field Reported Date will take the value from Created." here using the available options.
If you are looking to do something more elaborate, then script-runner may be what you need. I have not had a need for it at this point though.
We are running Enterprise Edition 3.13 (330) in case your screens apear different.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events