Parse Summary to populate multiple Fields

Issue #581 resolved
Arjun Adimari created an issue

Hi,

Currently we have a Mail Hnadler set up to automatically create Tickets in a Project with the Mail Subject = Summary of the ticket. I want to know if it is possible to parse the Summary of the created ticket to populate multiple fields. For e.g

Summary = Approve <Fixversion> release of Patch to <Label> on <DueDate>

The Summary should be parsed as a Post Create Function to populate the Fixversion , Label and Duedate fields. We are currently on v2.2.28

Regards,

Arjun

Comments (13)

  1. Fidel Castro Armario repo owner

    Yes, it's possible to do it. I have some questions:

    1. Is the subject's format always exactly like in the example?
    2. Which format is Due date? Can you use something like 2017-04-18 for date format?
  2. Arjun Adimari reporter

    Is the subject's format always exactly like in the example? - The format can be changed to make this work.

    Which format is Due date? Can you use something like 2017-04-18 for date format? - Yes we can use that format for DueDate

  3. Fidel Castro Armario repo owner

    Then, you can do it using the following 3 "Parse field for extracting data" post-functions with the following configurations:

    Extracting "Fixed versions"

    Captura de pantalla 2017-04-18 a las 12.55.52.png

    • Leading delimiter is: \s*Approve\s+
    • Trailing delimiter is: \s+release

    Extracting "Labels"

    Captura de pantalla 2017-04-18 a las 12.57.40.png

    • Leading delimiter is: \s+to\s+
    • Trailing delimiter is: \s+on\s+

    Extracting "Due date"

    Captura de pantalla 2017-04-18 a las 12.59.04.png

    • Leading delimiter is: \s+on\s+
    • Trailing delimiter is: \s*$
    • Value format is: yyyy-MM-dd

    Once configured, all 3 post-functions look like this:

    Captura de pantalla 2017-04-18 a las 13.00.42.png

  4. Arjun Adimari reporter

    Hi Fidel,

    Thank you for the detailed instructions. However i just tried it out and it did not work for me. I have set them as Post Function in the Create Transition. The draft has also been published and made active.

  5. Arjun Adimari reporter

    Hi Fidel,

    Now the Label is getting populated but the others are not. Please note the subject line has been modified a bit.

    This is my Email subject - Test - APPROVAL NEEDED for 1.1.1 deployment on PROD at 10:00 AM on 2017-04-01

    1.1.1 = Fixversion PROD = Label 2017-04-01 = Due Date

    Post_function_1.png

  6. Fidel Castro Armario repo owner

    Hi Arjun,

    The problem with Fixed versions might be caused by the first post-function, which is also setting that field. Please, try removing it.

    In relation with Due date: Is it possible that you have another post-function that is setting the field. Please, let me see all the post-functions in "Create issue" transition.

  7. Arjun Adimari reporter

    I moved the Fixversion post-function below the new one that did not work. So i deleted it and that didnt work either. There are no other Due Date related Post-functions. The complete list is below:

    post_function_2.png

  8. Fidel Castro Armario repo owner

    Hi Arjun,

    The problem with due date is that you are using two "on" words in your summary. Try using the following leading delimiter for Due date:

    \s+on\s+(?=\d+)
    

    In relation with Fixed versions, take into account that the fixed version should already exist in the project as a version. It will not be automatically created if it doesn't exist. Is this the cause of the problem?

  9. Arjun Adimari reporter

    Worked on both counts. Thank you so much, Fidel. Appreciate your detailed and swift responses to resolve this issue.

  10. Log in to comment