Forums

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

How to iterate over subtasks in a structure formula

Surekha Gupta
Contributor
August 28, 2023

How can I write a formula that iterates over all subtasks and checks if the value of a certain custom field in the subtask is undefined?

1 answer

0 votes
Stepan Kholodov _Tempo_
Community Champion
August 29, 2023

Hello @Surekha Gupta 

If you mean sub-tasks as in Sub-task issue type, then you can use a formula like this:
if issuetype = "sub-task" and !field_name: "undefined"

Best regards,
Stepan Kholodov
Tempo

Surekha Gupta
Contributor
September 6, 2023

Hi Stepan, 

Thank you for your suggestion. However, what I am looking for is a syntax equivalent to a "for statement" in C.

For (all subtasks for the current row){

      if subtask meets certain condition

            goto end 

      else

            aggregate subtask cutom field to parent

}

end

Stepan Kholodov _Tempo_
Community Champion
September 6, 2023

I'm afraid it's not clear to me what exactly you're trying to achieve in the structure. To avoid any misunderstanding, please share a screenshot of your structure with:

  • sub-tasks and their parents and
  • the column based on the field you need visible on the screenshot.

And please provide examples of what kind of data you want the formula to return.

Alternatively, you can reach out to us directly at our support portal and we continue the discussion there.

Best regards,
Stepan Kholodov
Tempo

Surekha Gupta
Contributor
September 6, 2023

Hi Stepan, I have another post for the same question that has screenshots and details but no one answered that, so I was trying to simplify/ask a more generic question.  Here is that post:

https://community.atlassian.com/t5/Jira-questions/Formula-to-find-longest-pole-if-all-subtasks-have-target-date/qaq-p/2459478

Does that help clarify what I am looking for?

Stepan Kholodov _Tempo_
Community Champion
September 7, 2023

Thank you. I responded to you in the mentioned post.

Best regards,
Stepan Kholodov
Tempo

Suggest an answer

Log in or Sign up to answer