Hi, I have a Form that I use to attach to an issue on JSM. This form has a Custom Field, which is a list of checkable Items (e.g. Custom Field of Softwares, with each software a single checkbox item).
I would like to automate the creation of a Checklist, based on the selected/checked values of the Custom Field. Preferably in a new Task or Subtask that is associated with the original Issue.
For example, if a user raises an Issue, the Form with the Custom Field of Software is attached. The user then selects the relevant software(s) and commits the Form. Right after that a Task or Subtask is created and has a Checklist with all selected softwares.
Hi @Alexis --
I love this idea. Unfortunately Atlassian does not have a native Checklist function available. I messed around and created a Table using the :black_square_button: emoji, but they aren't truly "checkable":
(I also figured out how to programmatically create such a table, but it is... ugly, involving making a Web Request to the REST API and hacking together JSON.)
I wonder if you already have a Checklist add-on or are thinking of getting one, like Checklist for Jira Cloud, or Issue Checklist for Jira or Checklist for Jira (OOOF, there are a lot of these.)
If so, it seems like most of those provide some mechanism for automatically creating Checklists. It would then be a matter of parsing your Form, which .... ooof, is a little complicated (and officially unsupported):
JSDCLOUD-10697 - Forms Automation: Access form fields with smart values (smartvalues)
... the documentation for Server/DC under the heading Access the contents of ProForma Forms, relating to entity properties also applies to cloud; however, be aware accessing form data this way is not officially supported.
Oooh nellie, yeah, that's a lotta work:
OH! I guess this is slightly good news: JSDCLOUD-10671 - REST API for ProForma/Forms in Jira has been resolved, which means that instead of hacking around in issue properties, there's a REAL API for Forms that you could query.
Now... this doesn't make Automation too much easier, since you'll still need to use Web Requests to access the REST API and then parse out the responses, but uh, I guess you don't have to use to use the Console as much to figure out your Form fields?
UGH, actually, in retrospect, it'd probably be easier just to use the old workaround:
As usual, I've probably given you more info than you wanted to know. :-}
LMK if you have any questions.
I'm trying it with Issue Checklist for Jira Free, but I still struggle with getting the automation. Add Checklist Based on a Custom Field Value (herocoders.com)
Do you have some experience with that addon? because when I try the automation, I get a textfield with the text, but no checklist?
Or, do you have a recommendation for a checklist addon?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, so yeah, the issue (probably) is that you're using a Form.
By default, Form Fields are not linked to Custom Fields (and from the documentation, Issue Checklist for Jira Free creates a new field called Checkbox Text).
So ideally what you could do is link the Checkbox field in your form to the Checkbox Text field created by the add-on.
UNFORTUNATELY, despite appearing to be a somewhat regular custom fields, it looks like Atlassian does not consider Checklist Text to be a"normal" field, and so it is not available to link to:
I also thought there might be a workaround by using an intermediary Paragraph/Multi-line Text custom field and copying the data, but Atlassian will not let you link a Checkbox form field to a Paragraph/Multi-line Text custom field:
So that probably would've blocked the Checklist Text idea too.
HUM.
So this will probably call for some hackery as mentioned before, digging out the checkbox values from the Issue Properties, and then doing something like editing the Checkbox Text field with something like:
{{#if(issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*\b1\b.*"))}}* [open] Foo
{{/}}{{#if(issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*\b2\b.*"))}}* [open] Bar
{{/}}{{#if(issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*\b3\b.*"))}}* [open] Bat
{{/}}
ALAS, THIS DOES NOT WORK.
Could I phone a friend, (@Bill Sheboy? Any thoughts on why my if statements are coming up empty? I did some testing:
RAW: {{issue.properties."proforma.forms.i1".state.answers.18.choices}}
JOIN: {{issue.properties."proforma.forms.i1".state.answers.18.choices.join(",")}}
MATCH: {{issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*\b(1)\b.*")}}
And yes, I even tried trying to iterate through all the choices, but I'm pretty sure it's not possible to match against {{.}}.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where my form checkboxes are Foo, Bar, and Bat, and examining the issue properties reveals them to be question 18, with ids of 1, 2, and 3, respectively:
{
...
"state": {
"visibility": "i",
"status": "s",
"answers": {
...
"18": {
text": "",
"choices": [
"1",
"2",
"3"
]
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I tried something similar, but it seems it goes back deeper.
If I input manually or automate to fill the Checklist Text with the "* format" then exactly this text will be written to the Checklist Text Field, but no actual Checklist Element appears. If I manually press the "Add Checklist" Button atop of the issue, a new Checklist comes up - seemingly totally separate the the Checklist Text field, because the Checklist Element is just empty.
When automating I also had to go to the Issue Configuration, and manually enable/drag the Checklist Text field in. If I don't do that, I get an Error on the Automation that the customfield 10081 is not available.
But, regardless, even if the field is on the issue, it seems not to change the actual Checklist
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Darryl Lee and @Alexis
I have been following this thread as the use case seems interesting and helpful, if it turns out to be possible :^)
Darryl, on your note about "alas, this does not work", I could guess 2 possible causes:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alexis - yeah updating the Checkbox Text wasn't working for me either UNTIL I looked more closely at the directions:
Ensure the Save local checklist items to Jira custom fields global setting is enabled..
Once I toggled that, I could create a standalone action of Editing the issue and updating the Checkbox Text field and it updated my checklist.
I didn't have to add the field to the screen. Is this a Company- or Team-managed project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great to hear from you @Bill Sheboy ! Yeah, I guess I got too fancy with my regex. Also, I neglected to do incremental debugging:
Here's my Audit log tests:
SIMPLE WILDCARD CAPTURE MATCH: {{issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*(1).*")}}
EQUALS: {{issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*(1).*").equals("1")}}
IF: {{#if(issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*(1).*").equals("1"))}}* [open] Foo {{/}}
And the results:
SIMPLE WILDCARD CAPTURE MATCH: 1
EQUALS: true
IF: * [open] Foo
Woot, so we are in business! Hopefully @Alexis doesn't have more than 9 checkboxes, because the match for "1" is going to match "10-19" too:
{{#if(issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*(1).*").equals("1"))}}* [open] Foo
{{/}}{{#if(issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*(2).*").equals("2"))}}* [open] Bar
{{/}}{{#if(issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*(3).*").equals("3"))}}* [open] Bat
{{/}}
So you might think you could search for: .*(1),.*, but you would be forgetting that also matches 11, 21, 31. This is why I really needed \b (word boundary). I also tried \D, and even the old school [^0-9] and they were all no-go.)
Now, last year in October @Yvan Martin wrote:
Currently the regex expressions in Automation are using Java pattern matching. So when trying out expressions is best to use one that you can select the Flavour of Java e.g. https://regex101.com/?flavor=java&flags=g. The reason ^ and $ aren't working is by default multiline is being turned off (you can simulate that in that regex link). So you need to use the manual way of turning it on which is putting (?m) at the start of the regex.
So yeah, if it was using the FULL Java regex class, then this query should've worked:
BOUNDARIES: {{issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*\b(1)\b.*")}}
I successfully tested it in the regex tester he recommended: https://regex101.com/r/WaBuuJ/2
And I think it should've returned Group 1, which contains 1. But since the example for match shows it returning what looks like an array or list [o, o], then ok, this should've worked, right?
BOUNDARIES FIRST: {{issue.properties."proforma.forms.i1".state.answers.18.choices.join(",").match(".*\b(1)\b.*").first}}
Nope. Nada.
So tell us Yvan, is Bill right, when he writes:
First thing: the rules documentation around regular expressions states it is "based on Java's Pattern class", and others have found not all of the features from that spec work. I find only experimentation confirms what does and does not work.
Because it would REALLY be nice if we didn't have to spend hours testing. I mean, not that I don't *LOVE* debugging. :-P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darryl Lee Setup-wise I think everything is correct, I also had the option for local checklist items already set. The project is company-managed, and it is a Service Project from JSM.
Did the field just appear automatically for you? So, if you go to a relevant issue and check the Dot Menu "Find your field", do you have any errors when searching for "Checklist Text"? Can you see the field in a tb or on the More Fields view on the right of the issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, Checklist Text is not a normal field, so I don't think it's supposed to be visible in issue views.
I believe the vendor makes it visible to Automation so that you can programmatically set it, and it will show up as in the vendor's Checklist section of Jira.
I am Editing it with Automation:
And putting my smart value hackery here:
And here's what I ended up with:
(I find it fascinating that it shows the timestamp of when my Automation ran. That's a neat feature!)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alexis
The Checklist Text custom field allows you to manipulate the Checklist using automation. You are able to set the Checklist based on certain field conditions using the Checklist Text field in automation. You would need to make sure that you have the "Save local checklist items to Jira custom fields" global setting enabled. This allows the values of the custom field to sync with the actual Checklist UI. You can add this field to the edit issue screen to view your Checklist in Text format.
If you still need help setting this up Kindly reach out to us here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, @Alexis
Have you considered an app like Smart Checklist? It can help with automatically creating checklists in issues. However, this will only help with the second part of your question...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alexis hi!
If you need specific help with setting up Smart Checklist, you are welcome to contact the Support Team at support@titanapps.io.
Best,
Olena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried out Smart Checklist, and the syncing works like a breeze. Amazing.
I created the custom fields, and in my automation I populate the "Checklists" field with the stuff from the form like this
{{#issue.Services}}- {{value}}\\{{/}}
the "\\" normally creates a new line. In Automation, if I use that for the "Description" field, it works like expected, creating a normal list with one item per line.
But the same approach leads to the Checklists field having this value:
- SoftwareA\\ - SoftwareB\\ - SoftwareC\\
Which leads to the Checklist component having only one item, which is
SoftwareA\ - SoftwareB\ - SoftwareC\
What can I do to make a new line? I tried \n and <br> but it seems not to work.
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.