Hi everyone.
When we open a bug ticket we have a table in the description that states information about the user who reported this issue. When another report is coming we add a new row to the user report table and add information and this can happen multiple times of course.
I would like to create a field that counts the number of rows in this table using automation. One of the challenges is that having multiple rows in a certain cell can give a wrong calculation.
Another method that I thought using but have no clue how is somehow to use JIRA forms.
Can anyone help me with this?
Few questions
Table is stored in markdown syntax format. I am thinking this can be used for parsing and calculating the number of rows in the table.
I managed to count rows, but if for example in the info header somebody entered a long sentence and pressed enter to create a link break, it will be considered as another user report.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share the rule that you have used?
Using regular expression Lines breaks can be handled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh this is difficult. I tried to use ChatGPT and he gave me every time something else. Do you have a suggestion?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am assuming you would have written the automation rule in JIRA to validate that count of rows is working correctly.
Can you share your working rule, and we can go from there?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{issue.Description.split("\n").filter(row => row.count("|") > 1).size}}
this is the last one i tried. Assume that description = user reports
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{description.split("\n").size}}
this one work for me for example. But as I said, it won't take into consideration line breaks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looking it another way as you are interested in reading number of rows in a table.
Table is represented by || for headers and | for body.
For 7 column table, there will be
Create this automation rule
Set smart value variable like this:
As long as your description has one table, it will work.
Let me know if it works for you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.