Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

issue.getSubTaskObjects() is not working Edited

Hi guys,

 

I'm using Script Runner version 6.2.1-p5 with Jira server version 8.6.1

 

I have a transition that contain 2 post functions (custom script).

First script => create a subtask

Second script => get the list of subtask (that was created from previous script).

 

In my second script, I use below code to get subtask:

Collection subTasks = issue.getSubTaskObjects();

 

But it doesn't work. My subTasks variable is still empty (although the subtask has already been created from my first script)

 

Anyone could give me an advise? I'd be much appreciated.

2 answers

0 votes
Nir Haimov Community Leader Oct 30, 2020

Hi @Joe Bkk 

Why are you creating this as 2 different post functions?

It might be that the sub-task not showing yet because the process of the workflow transition not finished.

I would suggest to it all in one post-function, no reason to make 2, specially if 1 depend the other

Hi Nir,

Thank you for your reply.

I've merged 2 script into 1 but it still doesn't work.

However, I notice that if I don't do fast-track (script runner) for this transition. Everything will work perfectly. Once I do fast track, I will have this problem immediately.

I believer something is related to the fast track.

Nir Haimov Community Leader Nov 01, 2020

So seems like you answer to your-self :)

Seems like the fast-track not performing the post-function script (and maybe all other post-functions you have in this step)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Learn how to request and manage app requests in the Marketplace

G’day everyone! Super exciting news coming from the Marketplace. We have now fully rolled out the ability for end-users to submit app requests to admins directly from within the product! No longer ...

43 views 1 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you