Is there a way to update the Fix Version automatically based on the date of Resolution?

Issue #952 resolved
Gowri Kumar created an issue

Hi,

I would like to set the Fix Version automatically from the available list of versions for the project, based on the resolution date. Can this be done? Example: Resolution Date: 17/01/2018

Versions: Version 1: Start Date: 01/01/2018, End Date: 15/01/2018 Version 2: Start Date: 15/01/2018, End Date: 31/01/2018

The Fix Version should be automatically set to 'Version 2' when the issue is resolved.

Comments (7)

  1. Fidel Castro Armario repo owner

    Hi @gowrik,

    You can use "Copy a parsed text to a field" post-function with the following configuration:

    Captura de pantalla 2018-01-17 a las 20.45.39.png

    String expression is:

    first(filterByPredicate(releasedVersions(), min(releaseDates(toString(filterByPredicate(releasedVersions(), {00112} < first(releaseDates(^%)))))) = first(releaseDates(^%)))) 
    

    where {00112} is field code for numerical value of "Date and time of resolution"

  2. Gowri Kumar reporter

    wow! Thanks a lot! :-) Can you also let me know how to handle this in case of unreleasedversions()? That is, if I want to set the FixVersion to an unreleased version (where the release date is not available) when there are muliple unreleased versions, based on Start Date. Is this possible?

  3. Fidel Castro Armario repo owner

    Hi @gowrik, sorry, but currently we don't have a function to retrieve the Start Date. We will try to include it in next version of the add-on.

  4. Fidel Castro Armario repo owner

    Hi @gowrik,

    Version 2.3.0 provides new function startDates() for retrieving the start date of versions.

    You can update to version 2.3.0 and use the following text to be parsed in advanced parsing mode:

    first(filterByPredicate(releasedVersions(), min(releaseDates(toString(filterByPredicate(releasedVersions(), {00112} < first(releaseDates(^%)) AND {00112} > first(startDates(^%)))))) = first(releaseDates(^%))) APPEND filterByPredicate(unreleasedVersions(), max(startDates(toString(filterByPredicate(unreleasedVersions(), {00112} > first(startDates(^%)))))) = first(startDates(^%))))
    

    The behavior is the following: in case that there are released versions with start date lower than resolution date and with release date higher that resolution date, then the one with lower release date is returned. Otherwise the unreleased version with higher start date that is lower than resolution date is returned.

  5. Log in to comment