Forums

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

How can I use a thread in a custom script post-function

Mack Chen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 30, 2019

Hello Everyone,

     I want to use a thread in a custom script post-function as following code.

Thread.start{
printf("will sleep")
Thread.sleep(4000L)
printf("slepp end")
triggerDPTransaction(actionUser, actionId, comment, dpIssue)
}

But it doesn't seem to work, can anyone help me? Thanks!

1 answer

0 votes
Tom Lister
Community Champion
January 31, 2019

Hi @Mack Chen

Thats an unusual request.

Do you mind if I ask what is the problem you are trying to solve from a functional point of view? There may be other options.

Mack Chen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 31, 2019

@Tom ListerThanks for your attention.The problem I want to solve as following:

I have two workflows, named 'DP' and 'DO', DP has two transactions, named 'a','b' and DO has two transactions, named 'c','d', when I click a, will trigger DO's c, and c has a postfunction to judge condition, if true, will trigger DP's b, then b will trigger DO's d. I did this, everything is OK, but the status on DP and DO is not correct, the DP's status should be B, and the DO's status shouled be D, but it's A and C. So I want to resolve this with thread at DO's c to trigger DP's c. Is the description clear?

Tom Lister
Community Champion
February 1, 2019

Hi

I don’t think the threading will give you any advantage here. You could try just calling your triggerSPTransition method  directly. 

Which plugin are you using to run script?

are there any transitions happening

are there conditions or validators that need to be met?

Suggest an answer

Log in or Sign up to answer