I have set up some automation rules that interact with each other to do the following:
This is accomplished via a few rules:
The issue is that {{Release notes comments.htmlEncode}} is a paragraph style field, and it appears like this in Jira:
The resulting confluence only shows this as a single bullet, and I would like to bullet each line in the paragraph. I can put bullets in the release note template itself, but confluence doesn't seem to recognize these even when I use wiki style formatting (this appears to be a known Jira bug). See example below
Any ideas for how I could get the webhook to bullet each line so it looks like the below?
Hi @Michael Fortunato -- Welcome to the Atlassian Community!
I suspect the Release Notes Comments field is losing its form of Jira markup and then getting re-interpreted when added to Confluence.
Have you considered splitting the field on line breaks and adding your own Confluence Markup for bullets: https://support.atlassian.com/confluence-cloud/docs/insert-confluence-wiki-markup/
Perhaps with:
{{#Release notes comments.split("\n")}}* {{.}}{{/}}
Kind regards,
Bill
@Bill Sheboy Ahh thanks for the response. I was looking around to see if there was a way to identify line breaks. Let me try this out and see if it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy so it looks like Confluence just doesn't respect the markup from the webhook. It just outputs the unformatted "* ". However, if i edit the page and remove the space and put it back, it turns it into a bullet.
However, the below seems to get me closer to the solution:
{{#Release notes comments.split("\n")}}<ul><li>{{.}}</li></ul>{{/}}
Produces the below:
However, now I need to find a way to produce the next bullet (e.g., the answer to the release note template)
Is there anyway to create a list from {{#Release notes comments.split("\n")}}{{.}}{{/}}?
For instance, maybe create a list from certain elements of the list?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you mean to add the * Notes list item after each comment line?
If so, how about nesting within the iterator:
{{#Release notes comments.split("\n")}}<ul><li>{{.}}<ul><li>Notes</li></ul></li></ul>{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, Notes isn't an actual value. I just put it as a placeholder for the text a user will enter. I think I will need to create a smart value in the automation that creates that value. I am just not sure how to specifically identify only the text on the second level bullet points in the free text field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also meant "Notes" as a placeholder...I was thinking people were entering the details on the Confluence page, and instead it appears you mean there could be 1-to-many "notes" entered in that field below each first-level bullet. Correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, correct. Basically, this template will be inserted into jira upon transition to Done. Then, the Assignee will insert another bullet level between each first bullet level in Jira. Then, the automation will pull all the information into a confluence for our customer teams to review. This way the information is documented in both places where all our relevant users can view.
So I suppose, I need a way to identify the sub-bullets and list them as a smart value. Not sure if this is possible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm...this could be a brittle solution that might work:
If you used heading levels (h1, h2...) in the Jira field, those could be used as split groupings, with the first split on h1 and then process (nest) the result with a second split on line breaks and h2 (or just lines) to add the additional necessary HTML.
I definitely recommend experimenting by just writing to the audit log a bit on the splits to determine how well this works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy Sorry, I am having trouble understanding why using heading levels will be different than bullets.
Aren't headings just interpreted as (# or ## for h1 or h2) vs bullets are (* or ** for 1st or 2nd level)?
Do you have an example of what you are suggesting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you write a field containing Jira markup to the audit log, you will see that bullets appear with a varying number of asterisks * (or pound signs #) and that heading levels are prefixed by h1, h2, etc. Those are distinct enough to allow splitting on a header first and then bullets.
Although now that I think about it...I suppose you could also try to split on a regular expression with just one asterisk first, and then split on the child lines. I'm gonna experiment with that one as split() is documented to accept a regular expression.
Update:
Scratch that idea: although it is possible to split on the h1 markup, it is not possible to split again/lower as unstructured data like text has no smart values to grab onto...only {{.}} in the iterator. Same problem using a regular expression to split on different bullet levels.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm testing out a couple different methods. Would like your thoughts.
{{ #if(lookupIssues.Release notes comments.split("\n").match(".*(\*\* [a-zA-Z0-9]+[^,]).*").size.gt(0))}}<ul><li>{{.}}</li></ul>{{ /}}
Not sure if that conditional would work or if I got it completely correct
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That smart value expression looks well-formed, and I don't know if it will work. You may need to experiment a bit and test this.
My understanding of your use case was something like below, and so I thought the nesting of lower level bullets (e.g. sub items) would prevent syncing them later in the output with their "parent" if they were extracted.
In this example pulling out all of the ** sub items would disconnect them from the parent and so they could not be synched later on the Confluence output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No your understanding is correct, and that is what I need. That is why I'm thinking my first thought won't work, but the second might. The other alternative is maybe creating a list of name/value pairs in json and then splitting that way, but I really am not familiar with how to operate on those fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I am out of ideas for this one. The markup differences is one problem and solutions with list iterators cannot easily be nested when there isn't structure to grab.
If those template/placeholder sections are stable, the safest approach may be independent custom fields, which you can manipulate easily onto the Confluence layout.
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.