Auto Resolve Jira issues

Issue #967 resolved
Nikhil created an issue

Hello Fidel,

We have already worked on this feature but there is a small challenge now. We need to auto resolve issues only if the Description field has "Category: Warning" and was able to successfully implement it using "Copy a parsed text to a field Function" with %{Description} ~ "Category: Warning" and %{Project key} in ["MTSTHRDTL"] . But, the above string has lot of spaces as mentioned below.

"<SPACE>Category:<SPACE>Warning"

The above logic doesn't work if the string has spaces between. Can you please help me in altering the logic asap?

Thanks, Nikhil

Comments (51)

  1. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Try any of the following boolean expression:

    matches(%{00001}, "Category\\s*:\\s*Warning") AND %{00018} in ["MTSTHRDTL"]
    

    where %{00001} is field code for Description, and %{00018} is field code for Project key.

  2. Nikhil reporter

    @fcarmario

    The above solution didn't work. Capture.JPG

    Did I miss anything? Status is not getting changed to "Resolved" neither the other fields.

    Nikhil The

  3. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Please, try the following boolean expression:

    matches(%{00001}, "Category:.*Warning") AND %{00018} in ["MTSTHRDTL"]
    

    BTW, I inform you that we have a new support site. Please, use the new support site for your future questions and support requests.

  4. Nikhil reporter

    @fcarmario, Still it doesn't work. Capture.JPG

    I have auto-saved the password and not able to recollect it. Allow me sometime to continue conversations in your site.

    Nikhil

  5. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Please, copy + paste the whole content of a real issue "Description" that contains the sub-string you want to detect (i.e., "<SPACE>Category:<SPACE>Warning") into a text file, and attach it to this issue, or send it to support@workflowarts.com.

    Thanks.

  6. Fidel Castro Armario repo owner

    Sorry, I used field code for Summary instead of Description.

    Please, they the following boolean expression:

    matches(%{00001}, "(?s).*Category:.*Warning.*") AND %{00018} in ["MTSTHRDTL"]
    
  7. Fidel Castro Armario repo owner

    I close the issue. Please, reopen it in case you need to.

    BTW, I inform you that we have a new support site. Please, use it for your future questions and support requests.

  8. Nikhil reporter

    @fcarmario , Can we expand the logic "matches(%{00001}, "(?s).Category:.Warning.*") AND %{00018} in ["MTSTHRDTL"]", with "Category: Error" and few more as well in the same post-function or do we need to add multiple post-function for each one ?

  9. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Try the following expression:

    matches(%{00001}, "(?s).*Category:.*(Warning|Error).*") AND %{00018} in ["MTSTHRDTL"]
    
  10. Nikhil reporter

    @fcarmario

    Status changes to Resolved when I tested this by manually creating a ticket and also by sending an email. But it failed to change the status to "Resolved" when we received an alert from client tool and stays in In Queue only. Any idea why this is happening? Is there anything that you want me to send to verify?

  11. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Can you, please, explain what you mean by "client tool"? How do you receive those alerts on JIRA?

    In relation to your previous question: yes, you should separate the different words using | character. That's regular expression syntax

  12. Nikhil reporter

    How about with different words/categories w.r.t. corresponding Summary/Alert name? For example, each summary has a category type so we have 10 different Summaries with 10 different categories in the ticket. Can we club and create an expression matching Summary and corresponding Category to allow that ticket to get auto resolved?

    Nikhil

  13. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Sorry, I don't understand exactly what you mean. I understand that you have 10 different summaries with 10 different categories, do you want to detect a subset of those categories? If that's the case you should use the following expression:

    matches(%{00001}, "(?s).*Category:.*(cat_1|cat_2|cat_3|cat_4).*") AND %{00018} in ["MTSTHRDTL"]
    

    replacing cat_1, cat_2, cat_3 and cat_4 with each of the categories you want to detect.

  14. Nikhil reporter

    @fcarmario I was telling something like this which I have written and working well.

    Post-function will only be executed if the following boolean expression is satisfied: matches(%{Description}, "(?s).Category:.Warning.") AND matches(%{Summary}, "(?s).Log Source License Limit.*") AND %{Project key} in ["MTSTHRDTL"]

    We have 20 different summaries but similar Categories, so we may have to use both Description for Category and Summary for as well to get the right parsing. So, can we accumulate multiple such summaries in a single expression and pipe (|) the categories so that any matching can perform auto-resolve?

    Please let me know if we can have a quick call to explain you better. I can show be better than I explain in this chat.

    Nikhil Nikhil

  15. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Try the following boolean expression:

    matches(%{00001}, "(?s).*Category:.*(cat_1|cat_2|cat_3|cat_4).*") AND
    matches(%{00000}, "(?si).*(Log Source License Limit|another summary|another one|etc).*") AND
    %{00018} in ["MTSTHRDTL"]
    
  16. Nikhil reporter

    Let me try and get back to you. This is working as expected. Thanks for your support. But one important thing, can this be applied for all the old Jira tickets created before we implemented this? There are lot of such implementations we did like parse and copy a text to a new custom field which needs to be applied for older tickets as well? Is this possible?

  17. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Sorry for the delay in my response. I don't know whether I have correctly understood your question.

    Assuming that the 4 post-function of your screenshots are inserted in a transition that you can't execute again for old tickets (maybe in "Create Issue" transition), then you can create a global reflexive transition called "Process Old Issues" and add the same 4 post-functions to it. Then you can use JIRA's search feature for selecting the old issues you want to process, and use bulk operation for executing transition "Process Old Issues" in all selected issues.

    Global reflexive transitions are available from all statuses of the workflow, and don't change the status of the issues, since they have the same status as origin and destination.

    The following screenshot shows how to create a global reflexive transition:

    global-reflexive-transition.png

    Please, let me know whether this approach satisfies your needs.

  18. Nikhil reporter

    @fcarmario ,

    But does the above setup help me to update custom fields as well in bulk? I have a field "Offense ID" which stores value by parsing and copying from the Description field. Currently, our workflow does this with the help of a post-function for all the issues getting created. But, before we implemented this change, we have around 2000+ issues for which we need to have the "Offense ID" field available with the value that gets stored with the help of the post-function. Can we run this post-function for old tickets to have this field and it's value make visible?

  19. Nikhil reporter

    Hey, sorry it worked. Yes, you were right in understanding me. I will get back to you again.

    Thank you!!

  20. Nikhil reporter

    Indeed it is. I was out of station so I couldn't. Thanks for your support. Any future communications would be done in your new portal.

  21. Nikhil reporter

    The Auto-resolve seems to be working as per the condition, but the Resolution and Ticket Category fields are getting auto-updated for tickets with other categories as well. There is some problem here and I would like to close it down in this ticket here itself instead of opening a new one in your new portal. Would you mind if we could fix this feature here itself?

    matches(%{00001}, "(?s).Category:.(Warning|Error).*") AND %{00018} in ["MTSTHRDTL"]

    The above thing works for changing issue status to Resolved, but it is affecting few of the other tickets as well.

    Nikhil

  22. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Please, double check that you are using the exact same boolean expression in parameter Conditional execution in all the 3 post-functions.

    You can copy+paste the boolean expression from post-function to auto-resolve in the post-function for setting fields Ticket Category and Resolution.

  23. Nikhil reporter

    Yes, I did. But the result is strange Can we have a skype call for few minis and show you the change?

    Capture.JPG

  24. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    I can have a Skype meeting at 14:30 UTC, i.e., in one hour. Is that OK for you?

  25. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    First of all, sorry for the delay in my response.

    Please, try the following alternative boolean expression at parameter Conditional execution:

    matches(%{00001}, "(?s).*Category:[ ]*(Warning|Error).*") AND %{00018} in ["MTSTHRDTL"]
    
  26. Nikhil reporter

    @fcarmario,

    Sorry, I was on a vacation and couldn't reply so reopening this ticket for further assistance. The above logic of auto-resolving worked independently, but this logic doesn't work when I add couple of more such post-functions for auto-updating custom fields Ticket Category and Resolution. This is happening in Production instance. See Below: Capture.JPG

    When an alerts come in and generates a ticket, if there is only one auto-resolve post-function, it works. If I add 2 more of custom field updation then auto-resolve won't work but fields gets updated. See Below:

    Capture.JPG

  27. Nikhil reporter

    @fcarmario Except Status, I am able to auto-update rest all other fields like Resolution, Assignee, Ticket Category and Comments. These are the mandatory fields that needs to be filled inorder to Resolve ticket.

  28. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Sorry for the delay in my response.

    When you are executing an auto-transition on a same issue, the transition execution happens with some delay (1 second in your case). You want see the issue in the new status until you reload your browser after executing the transition where you inserted the post-function for doing the auto-transition.

    Please, reload your browser and let me know whether issues is resolved or not.

  29. Nikhil reporter

    I usually reload a lot of times but nope it won't. Can we set a call at 3pm ist today so that i can show you through screen sharing? Reloading did not work and even i tried replacing with just Issue Status(without Time Delay)

  30. Fidel Castro Armario repo owner

    Sorry @nikhil_dsv,

    I won't be available today nor tomorrow. Please, try the following:

    Replace "Copy a parsed text to a field" for transitioning the issue, with "Transition issues" and use options for skipping conditions and validations.

    You will need to update to the most recent version of the add-on. In case you can't, please attach screenshot of conditions and validations tab of transition for resolving the issue.

  31. Nikhil reporter

    Let me try this and get back to you. Once back please do let me know for a quick call.

    Thank you so much.

    Nikhil

  32. Nikhil reporter

    I have updated and able to create a post-function as transition issues. Same post-function is working in our Stage Jira and not in Production Jira.

  33. Fidel Castro Armario repo owner

    Hi @nikhil_dsv,

    Please, ensure that you checked the following options in both instances (stage and production):

    Captura de pantalla 2018-03-21 a las 11.55.27.png

  34. Nikhil reporter

    Yes, I did. Can we please jump on a quick Skype call as I have this changes available in Production? A very quick one. I will show you what's happening so that we can close this thing off

  35. Fidel Castro Armario repo owner

    Please, Nikhil, don't forget to close this issue and the one at JWT Service Desk. Thanks.

  36. Nikhil reporter

    The incoming alerts from the client tools aren't getting auto-resolved still. The users have to resolve them manually. Must I uncheck Delayed execution by chance? Kindly, assist.

  37. Log in to comment