How do I use a wiki markup formula to indicate if a specific field has multiple entries.

Marc Formisano April 28, 2023

For example, if there is a field called "worked iterations" and the value is either empty or has values that show up in the same column separated by commas I would like to indicate 1 value as GREEN, 2 values as ORANGE and 3 or more values as RED.  An example of "worked iterations" with 3 values is:  2023-1 Dec 7 - Feb 28, 2023-2 Mar 1 - Apr 25, 2023-3 Apr 26 - Jun 20

1 answer

1 accepted

1 vote
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2023

Hi @Marc Formisano so you're talking about wiki markup so you're probably talking about a custom field of type Text Field (multi-line).

So I think you're saying that in this table in your "worked iterations" field:

||heading 1||heading 2||dates||
|row A|col A2|2023-1 Dec 7 - Feb 28|
|row B|col C2|2023-2 Mar 1 - Apr 25, 2023-3 Apr 26 - Jun 2| |row C|col C2|2023-1 Dec 7 - Feb 28, 2023-2 Mar 1 - Apr 25, 2023-3 Apr 26 - Jun 2|
 

You would want the last cell in row A to be green, row B to be orange, and row C to be Red?

HUH, that's interesting. AFAIK Jira's text formatting does not allow for any conditional formulas.

I googled for: wiki markup conditional jira

The only thing that seems relevant (but also massive overkill) seems to be Structure:

OH, I thought of a pretty gnarly hack using Automation for Jira:

You could parse that field after creation (or maybe also whenever it gets edited), using the match operator using a regular expression like "\d{4}-\d \w{3} \d+ - \w{3} \d+" and then get the size of the list returned, and then make that part of a condition to add {color:red} tags around the text. And this would all have to be used in conjunction with replace or replaceAll. Hum, I just don't know.

I think another problem is this that would only work if the table had ONE row, because ... I don't think there's a way to iterate over multiple lines.

Any thoughts, @Bill Sheboy ?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2023

Hi @Marc Formisano -- Welcome to the Atlassian Community!

Adding to the answer from @Darryl Lee ...please consider the answers to these questions as they may help the community offer suggestions:

Are you using Jira Cloud or Server/Data Center?

What is the type of the field, "worked iterations"?

Is your scenario "when I enter/change values in the Worked Iterations field, I want the field values' color to change based on the number of selected items?"

When you described this scenario to your Jira admin, what did they suggest?

 

Kind regards,
Bill

Like Dave Rosenlund likes this
Dave Rosenlund
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 1, 2023

Hi, @Darryl Lee & @Bill Sheboy.  90% sure @Marc Formisano is indeed talking about a Structure Formula so it may not be massive overkill if he's already using Structure for other reasons (and I am also 90% sure he is). 😊

You'll get more/better/quicker help, @Marc Formisano, if you can confirm cloud or data center (if you work for the company I suspect you do, you're on data center) and that indeed you're talking about Formulas in Structure.

Best,

-dave

Like Darryl Lee likes this
Marc Formisano May 1, 2023

I was able to accomplish this using the size() formula, emojis and wiki markup.  Thanks for your responses

Like # people like this
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 1, 2023

Ha, I need to do a better job of reading tags. As @Dave Rosenlund surmised and @Marc Formisano confirmed he was using Structures, just like the tags say:

Screenshot 2023-05-01 at 8.57.23 PM.png

Whoops!

Like Dave Rosenlund likes this
Dave Rosenlund
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2023

You're good, @Darryl Lee. 👍

I added those tags after @Marc Formisano confirmed he was using Structure with his reply. This way future community visitors might find the post and answer more easily.  

Suggest an answer

Log in or Sign up to answer