Forums

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

Can i automate a workflow so if i push the completed button it raises a new ticket?

Mate Major November 23, 2018

Hello,

I would like to have a workflow where if i click on 'Resolve' the ticket it automatically raises another issue. Is that possible in Jira Cloud?

 

Best

Máté

2 answers

2 accepted

0 votes
Answer accepted
Mate Major December 10, 2018

Allrighty so i have tried everything and it still doesnt work. Which variables would you need in order to make it work, could you maybe send a screenshot how the issue looks in the backend and then i can compare it to mine. Sorry for the many questions, im kind of a noob in this :)

Thanks a lot for all your help!

0 votes
Answer accepted
Alexey Matveev
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.
November 23, 2018

Hello,

You would need an add-on for it. 

For example, you could use the Power Scripts add-on:

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview

You could create a post function for the Resolve transition, which would create another issue. You can find an example of such a code here:

https://confluence.cprime.io/display/SIL/createIssue

Mate Major December 7, 2018

Thanks very much for your answer Alexey,

Could you maybe help me how to implement this exactly?

Im having trouble with it, it does not seem to work.

 

Thanks

Alexey Matveev
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.
December 7, 2018

You need to install first the Power Scripts add-on. Then you need to add a post function to the transition, which leads to the Resolved status with a code like this:

string issue_priority;
//Possible values: "Major", "Critical" etc.
string issue_description;string issue_security_level; 
issue_priority = "Critical";
issue_description = "Description of the issue";
issue_security_level = "Administrator";
string k = createIssue(
            "PROJECT",
            "",
 // passing in empty to create a regular issue rather than subtask
            "Bug",
            "Summary of the sub task" ,
            issue_priority,            issue_description,            {},
 // no components
            currentDate() + "30d",
            "1h 30m",            issue_security_level,
            {}
 // and no custom field mappings           );
Mate Major December 10, 2018

Thanks a lot, however this code gives me an <EOF> error at line 18.

Alexey Matveev
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.
December 10, 2018

Try like this:

string project = "TP";
string parent_key = "";
string issue_type = "Story";
string issue_summary = "Sample Issue #";
string priotity;
string issue_description = "";
string[] components;
date dueDate;
interval estimate;
string securityLevel;
string[] issue_fields_mapping;


string newIssue = createIssue(project, parent_key, issue_type, summary, priority, issue_description, components, dueDate, securityLevel, issue_fields_mapping);

Mate Major December 10, 2018

Still gives an error :(

 

Error reads: 
Exception while executing SIL program >>create new issue<<: [SIL Error on line: 14, column: 19] null

Alexey Matveev
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.
December 10, 2018

Some of the variable are empty in my script. I guess, you ve got some of the fields required. Try to fill variables with values.

string project = "TP";
string parent_key = "";
string issue_type = "Story";
interval estimate;
string securityLevel = "";
string[] issue_fields_mapping;


string newIssue = createIssue(project, parent_key, issue_type, summary, priority, description, components, dueDate, securityLevel, issue_fields_mapping);

Mate Major December 10, 2018

Ah okkay, and what would string parent_key mean in this case?

Alexey Matveev
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.
December 10, 2018

If you create a sub task, you need to provide the key of the parent issue in this variable.

Mate Major December 17, 2018

Okay so i understand now why it says null. Could you maybe help how to add values to the variables in the Create Issue bracket? IT doesnt let me do it and thats why it doesnt work.

 

Thanks a lot

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events