update subtask status with comments

Issue #177 resolved
Raju Adluru created an issue

Hi Fidel I need your help in implementing voting in an issue. I am creating 4 subtasks to send to 4 teams to vote on an issue for release. want to update subtask status, from comments they add to subtasks. it is working now for any comments it will change to approved, but i want to check the comments and approve or deny based on text in comments.

i am using your add on to parse and update status in advanced mode. Below is code, using if last comment = approved then change status, i am getting error for below code, can you please check and guide me.

1 If %{00109} = Approved then %{00016} = Approved 2 If %{00109} = Denied then %{00016} = Denied

thanks fidel post function.PNG

Comments (7)

  1. Fidel Castro Armario repo owner

    Hi Raj,

    You can implement that behavior using "Set a field as a function of other fields" post-function with the following configuration:

    conf-0.png

    Setting rules used are:

    i(\s*approved\s*)Approved
    i(\s*denied\s*)Denied
    

    The configuration shown ignores characters case and blank spaces, i.e., it admits " Approved", "approved ", or " APPROVED ".

    If you want more strict matching checking, then use the following setting rules:

    (Approved)Approved
    (Denied)Denied
    

    Regards,

    Fidel

  2. Raju Adluru reporter
    • changed status to open

    Fidel when i put it in a transition, i have to click on transition, which anyway will change to approved or denied. my work flow is like this - open to approved, open to denied, all to closed

    I want to change the status from to Open to approved or denied based on comments, in this case where should i put this post function?. i think it should be listener or something else. currently i am using - JIRA automation plugin - https://marketplace.atlassian.com/plugins/com.atlassian.plugin.automation.jira-automation-plugin, which does not have validation to check comments, whatever comments i put, it will approve.

    thanks

  3. Fidel Castro Armario repo owner

    Hi Raj,

    Please, try the following solution:

    1. Insert a reflexive transition at "Open" status (i.e., a transition with "Open" as origin and target status), and call it "Check last comment".
    2. Insert condition "Hide transition from user" in transition "Check last comment". This condition will make this transition only available for "JIRA Automation" listeners.
    3. Insert post-function "Set a field as a function of other fields" with the same configuration as described in my former comment, but selecting "Issue status (delayed writing)" in parameter "Target field to be set".
    4. Configure a listener with "JIRA Automation" for executing transition "Check last comment" each time a comment is created or edited and issue is in status "Open".

    Please, let me know if this solution works for you.

    Regards,

    Fidel

  4. Log in to comment