Forums

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

How to clone test cycle after test cycle was finished?

heysunny
February 25, 2020

Hi all,

we're using Test Management 4 Jira at our company, and I'm trying to create a ScriptRunner listener that clones the actual test cycle (with all test cases in it) with a new name once the test cycle was finished. Apparently I should be able to do it with the TM4J API however I'm new to ScriptRunner and I'm not quite sure how to a) make an API call from within a listener & in groovy, b) what service(s) to use to clone a test cycle.

Any help is appreciated, thanks!

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Nitinraj
September 15, 2023

Hello @congo bongo ,

Are you able to find the solution? I am also stuck in the same.

0 votes
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 Champions.
January 29, 2018

I think the problem is with

{MailAttachment a -> ${it.filename}

What are you trying to do with the line?

congo bongo
January 30, 2018

yeah i want to attach the file to the mail being generated

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 Champions.
January 30, 2018

If you want to send a email then you would need implement something like this

Email email = new Email("dieter@home.at"); 
email.setFrom(fromStr); email.setSubject("Hello"); email.setMimeType("text/plain"); email.setBody("Body Text"); Multipart multipart = new MimeMultipart("mixed"); MimeBodyPart attachPart = new MimeBodyPart(); String attachFile = "/tmp/SLA_Report.csv"; java.io.File csvFile = new java.io.File("/tmp/SLA_Report.csv"); FileDataSource source = new FileDataSource(csvFile); attachPart.setDataHandler(new DataHandler(source)); attachPart.setFileName(csvFile.getName()); multipart.addBodyPart(attachPart); email.setMultipart(multipart); SingleMailQueueItem item = new SingleMailQueueItem(email); ComponentAccessor.getMailQueue().addItem(item);
Like Kiran Jonnada likes this
congo bongo
January 30, 2018

aint that over the top, when using "Send a custom email" under "script listeners" setup..?

Theres a customizable section called "Custom attachment callback" that i try and run the script in.. triggered on all transitions in a certain project that has adds a comment on any issue (then post a mail to the reporter on that comment containing any new attachments, however the build-in option for new attachments via scriptrunner doesnt work anymore, since attachments arent loading in the same transaction as the comment.. (i believe))

congo bongo
February 1, 2018

is there really no way to attach the new attachments into a custom email? -the embedded feature doesnt do the job..

TAGS
AUG Leaders

Atlassian Community Events