Forums

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

Structure Formula to Highlight Multiple Components ?

Leo Nishanth Anthony
Contributor
September 8, 2023
Hello Experts I would need help with your expertize

Business Case:
I reach out to different development team units example as below
  1. Unit A
    1. Team A1
    2. Team A2
    3. Team A3
  2. Unit B
    1. Team B1
    2. Team B2
    3. Team B3
  3. Unit C
    1. Team C1
  4. Unit D
    1. Team D1
    2. Team D2

My Request is as follows

If any of the request has TeamA1 or Team A2 or Team A3 as component, the formula should highlight that it belong to Unit A

If any of the request has TeamB1 or Team B2 or Team B3 as component, the formula should highlight that it belong to Unit B

If any of the request has TeamC1 as component, the formula should highlight that it belong to Unit C

If any of the request has TeamD1 Or Team D2 as component, the formula should highlight that it belong to Unit D

I can realize this with If condition but i am facing the problem  when a request is having multiple component

Example - Meaning if a request has TeamA1 and Team B2 and Team B3 and TeamC1, the formula should highlight that it belongs to Unit A and Unit B and Unit C

Example - Meaning if a request has TeamA1 and Team B2 and Team B3 and TeamC1 and TeamD2, the formula should highlight that it belongs to Unit A and Unit B and Unit C and Unit D

Could you kindly help with what formula combination to use here, thanks in advance for your help and support!

1 answer

1 accepted

1 vote
Answer accepted
Leo Nishanth Anthony
Contributor
September 11, 2023

Found this answer from Structure SME in Slack and works well!

WITH unit_a =
IF components.CONTAINS_ANY(array("TeamA1", "Team A2", "Team A3")) :
"Unit A" :
WITH unit_b =
IF components.CONTAINS_ANY(array("TeamB1", "Team B2", "Team B3")) :
"Unit B" :
WITH unit_c =
IF components.CONTAINS("TeamC1") :
"Unit C" :
WITH unit_d =
IF components.CONTAINS_ANY(array("TeamD1", "Team D2")) :
"Unit D" :
MERGE_ARRAYS(unit_a, unit_b, unit_c, unit_d)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events