Simple XL release task is failing

55 views Asked by At

I have a very simple task, a Groovy script, which takes a variable, and splits it into a list, then prints the list. It does exactly this, then fails the task. I don't understand why, because it literally runs through the script and then should exit successfully as far as I'm aware. If I try to manually complete the task in the script, it hangs.

Here's the script:

def jira_tickets = releaseVariables['jira_Ticket_list'].split(',')
releaseVariables['jira_tickets'] = jira_tickets

println("Tickets: ${jira_tickets}")

I've tried it with this line added:

taskApi.transitionTask(task.id, 'Complete')

Which is what causes it to hang. I've also tried to use error handling, and it doesn't have an error, the output is merely exactly what I want it to do. Why is this failing the task at the end?

2

There are 2 answers

0
Soop On

I still don't know the reason it was failing, but I switched to Python and it worked, so that is the solution.

0
Vinay On

Use Async.

taskApi.transitionTask(task.id, 'Complete').async()

After printing the list of tickets and then start the task in the background. The script will then continue executing and will not hang.