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

How can I count the lines of a custom field or the length of a list? Edited

Hi,

I have a custom field, where we enter the names of all customers who are interested in a feature. This is great to see who to contact, before conceptualizing a new feature. But I would also like to get some quantitative insights about how many customers are interested. So I would like to count the line of the custom field. Currently, we use unordered lists:

  • customer 1
  • customer 2
  • customer 3

If I could get the length of the list, or the count of lines I would directly receive the number of interested customers.

I tried a workaround by just using the `{{issue.Interested Customer.length}}` but it returns the length of the entire string which is not really representative.

Does anybody have an idea how to solve this.

1 answer

1 accepted

1 vote
Answer accepted

Hi @Nicolas Mezou  -- Welcome to the Atlassian Community!

First thing: thanks for this question, as it helped me find a new defect in the automation rule conditions... Once a text field has been set, it cannot show as "is empty" ever again.  (I will submit a defect for that.)

On to your question... I did this counting by splitting the text and counting the new line characters.  Here is an example rule putting the customer list in Description and logging the results.

  • Trigger: manual, or whatever you need
  • If/Else, Advanced Condition: {{issue.description.length}} equals 0
    • Action: log that the count is zero
  • Else, Advanced Condition:  {{issue.description.length}} is greater than 0
    • Action: log that line count is {{issue.description.split(".*\n").size}}

Note that when there is only one customer (one bullet), the count should still be correct even though there is no new-line character.  That seems to be a behavior of split() returning the unmatched string.

Best regards,

Bill

Awesome, thank you so much @Bill Sheboy !

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,184 views 8 28
Join discussion

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