Darryl Lee Community Champion

Comments

  • @Bill Sheboy Re: multiple blocks of red text in a single comment, interestingly, match actually does work with multiple matches, and returns a list! I spent a little time trying to both detect if it is a list, and if so, iterate through each item. Couldn't get either one to work. :-/ But it sounds like that's probably an…
  • Hrm. Does split support newlines (\n?). I was thinking of hacking around with a few replaceAll commands, trying to replace everything up to and including \{color:#ff5630\} tags (but not closing \{color\} tags) with asterisks (bullets), and then \{color\} tags (and everything afterwards?) with newlines.
  • Ok, thanks @Bill Sheboy for the pointer. I regrouped and now this rule is much simpler (and simultaneously a lot more complicated): The code: RED TASKS: {{#issue.comments}}{{#if(exists(body.match("\{color:#ff5630\}(.*)\{color\}")))}}* {{body.match("\{color:#ff5630\}(.*)\{color\}")}}{{^last}} {{/}}{{/}}{{/}} So, because…
  • *Dope slap* Of COURSE it's asynchronous executions rearing its ugly head. I'll try to hack together a filter. I mean, that sounds like fun. :-}
  • Gah, and I realize now my logic is wrong because if it was working you'd empty with empty bullet points for any comments that don't have any red text. So I put an IF condition in there, and again, the Audit Log is showing the right comments: RED COMMENT: DON’T FORGET THIS TASK, RED COMMENT: HERE IS ANOTHER TASK, RED…
  • Hey, I almost have this, but I'm missing something. Maybe @Bill Sheboy can give me an assist? I first Edit Description (Assuming it's empty until you do fill it up with the Red tasks. Otherwise you would edit a Custom Field): All of the Red Tasks: Then I use Advanced Branching to iterate through all of the comments, and if…
  • Hi! The main problem is what @Colton_Kosicek mentioned last. You don't need to use issue.parent, because that's for subtasks, etc. To avoid confusion, instead of "parent", let's call it the original project. And because Description is a pretty standard field, you don't even need to use Advanced Field Editing where you get…
  • @Bill Sheboy hehe. Documentation? For something in the path internal-api? Unlikely. :-} But since it does have /gateway/api in the path, I was hoping there was a chance that it could be obtained programmatically. As mentioned, the URL/method was found by watching the network requests in Chrome when I dropped down the menu…
  • And speaking of APIs, as previously mentioned, I couldn't even get this endpoint to work for exporting the darn rules: https://MYSITE.atlassian.net/gateway/api/automation/internal-api/jira/<CLOUD-ID>/pro/rest/GLOBAL/rule/export (Like, it works from the browser where I have an active session, but I cannot get it working…
  • Thanks @Bill Sheboy Yeah I don't know if we'll ever see a full IDE or even REST API for this, although we can dream, right? ANYWAYS, regarding my rule's cataloging, my little Perl script outputs CSV that looks like this: Name, Description, Enabled, Key, Project "[Add lusers |…
  • I wrote the long article. It's here: Hacking/Parsing Automation Rules with JSON for Fun and Profit 
  • I apologize for dumping a pretty dense and technical set of text up there, but this has been sitting around for a while, and I figured it'd be good to at least get the information published in case anybody ends up searching for things like this. To be clear - learning jq and parsing JSON can be incredibly daunting, and I'm…
  • Hi @Oliver Berger - I've been meaning to write something up about my experiences exporting rules as JSON and then treating them as code. As I wrote here: * Rules are formatted as JSON, which is a tool for storing/presenting data in a human-readable format. * There are lots of tools/libraries for parsing/manipulating JSON…
  • Jira rises from the ocean, steam spilling out of his nostrils, hinting at the fire within his belly. As he opens his mouth, a mighty roaring flame emerges, and the sound, the horrible, hideous sound. (Go)Jira: NO MOAAARRRRR BUGGGGGGSSSS!!!!!! A fleet of tiny boats, each with teams of developers, designers, program…
  • Hi, sorry to Necropost, but I was looking for the answer to this, and unfortunately I don't think Joseph is correct. https://support.atlassian.com/jira-cloud-administration/docs/import-data-from-a-csv-file/ You can import issues with multiple comments by entering each comment in a separate column. (So the trick is to have…
  • I recently discovered this API and played with it just a little. Didn't try disabling any users (ours are Managed, so I don't think it's even possible), but I did figure out how to format the authentication header, which might be helpful: Authorization: Bearer YOURAPIKEY
  • Oh right, the easiest way to copy from one field to another is probably export to and import from CSV: https://community.atlassian.com/t5/Jira-questions/What-s-the-easiest-way-to-batch-copy-one-field-value-into/qaq-p/1653966 https://support.atlassian.com/jira-cloud-administration/docs/import-data-from-a-csv-file/
  • If there is already data in your existing Reviewer field, you'd probably want to: * Rename the field something like MultiReviewers * Create a new field called Reviewer * Bulk copy values from MultiReviewers fields to Reviewer (Hopefully nobody chose multiple reviewers?) (Details in post after this on using CSV…
  • Hi @chandraprakash I've answered inline: 1.how can I connect with my Jira cloud using python ? You can connect to Jira Cloud through REST APIs. There are several libraries available. I think the best maintained one is probably this: https://github.com/pycontribs/jira But you might also look at these: *…
  • I know I'm necroposting, but I was excited to find this, and thought it *might* be useful: If your IdP is properly syncing with Access (mine is not yet :-(, then you should be able to use the User Management REST API to find Job Title and Department, which are the only attributes that currently can be synced. I followed…
  • Ah, ok makes sense that you'd want to minimize extra branches with multiple issue creation. Speaking of checking for an empty array, I didn't think about that until I tried to solve @Stefan Salzl's problem using a similar approach. Please see my updated code below, that in fact checks to make sure the triggering issue's…
  • I lied. :-} I couldn't help myself. Here's the corrected JSON: { "fields": { "labels": [ {{#if(not(triggerIssue.labels.isEmpty))}} {{#triggerIssue.labels}}"{{.}}"{{^last}},{{/}}{{/}}, {{#destinationIssue.labels}}"{{.}}"{{^last}},{{/}}{{/}} {{/}} {{#if(triggerIssue.labels.isEmpty)}}…
  • Ooof, I realize this "fix" has the same problem as what I thought was going to fix @Stefan Salzl's issue: I didn't account for the possibility that the original issue may not have *any* labels. Augh. So in that case I end up with an extra leading comma, which is not valid JSON: "labels": [,"new-label"] Ok, the fix is…
  • AH, I think I forgot to take into account this case: * If the blocking issue (originalLabels) does not have any labels, then I should not include a comma. Basically I ended up it trying to update with this invalid JSON for labels: "labels": [,"childlabel1","childlabel2"] (Note the extra leading comma.) Ugh.... I think this…
  • So as I mentioned in the other post, the error you got is because the "add" function can only take a string, not an array. But after solving Dane's issue with a bunch of ugly Smart Value JSON hackery, I realized your problem wouldn't be much harder. It requires a temporary variable, because once we branch to the…
  • Oops, my idea above isn't quite right, because I ended up with this error when trying to both Copy Labels from the Current Issue *and* add the extra one in the More options -> Additional fields JSON section: Error creating issue Field 'labels' cannot appear in both 'fields' and 'update' So then, as mentioned in the other…
  • I really don't think that adding a label afterwards will slow it down that much, and it's a much more readable rule. But since I'm a glutton for punishment... Figured out how to make this work via Advanced editing using JSON using a few replaces, along with a split, and then another conversion back to an array: { "fields":…
  • @Dane Kantner Adding a label to the newly created issue should not affect the triggerIssue. As to @Stefan Salzlssue, it looks like the "add" function can only take a string, not an array. I think there's a way to expand out the array but I need to test if it works with "add"... standby.