access field prev values

Issue #908 resolved
Kosta Krastev created an issue

hi fidel,

again sorry- might be a simple q- that i just have not figured out from reading your extensive documentation. Trying to resolve the following

  • create issues (post function ) on action
  • dependent on a custom field - (multtiple list or checkbox (multiple choice)
  • works great with the provided funcitonality but - my workflow has a reopen like issue flow
  • trying to do the following - if the field has changes - create or delete based on newly added . removed options
  • the selector is used as a subtask trigger
  • got it to work with a hidden field that stores previous values but was wondering if there is a more elegant way or if there is a function to access the 'changelog' for a field

many thanks for the wonderful plugin and your hard work supporting it

regards Kosta

Comments (6)

  1. Fidel Castro Armario repo owner

    Hi @kosta_Krastev,

    Thank you for your kind words. I need to see your current configuration in order to see if I can provide a simpler alternative. Can you, please, attach a screenshot with your post-function's configuration?

  2. Kosta Krastev reporter

    fieldHistory.PNG

    here it is nothing fancy. Basically have a 2 fields (custom checkboxes); want to ensure that if the issue is reflowed; transition is on open to progress state. (i.e. open - > in progress-> closed - > reopened - > in progress) the post Function does the following

    first pass - values in checboxes = element1, element 2,element 3 - > create 3 Reopened (value of checboxes select = > changed) reopened- > in progress - compare Current Set of values in Checkboxes to Previous Set of values that was initially to Current set of flags - Create ONLY the Difference. on the second pass (reopen) I have as values = element 1, element 3, element 5 = > Create only 1 Issue = Element 5

    Appreciate your help Regards Kosta

  3. Kosta Krastev reporter

    well obviously I did not read through the wiki well - a few prints to see what I am doing did the trick of resolving. should be using previousValue and not fieldHistory

    Just as a sidequestion - how can I grab a specific index number of fieldHistory is there a direct method or regex? thx much

  4. Fidel Castro Armario repo owner

    You can use the following seed string expression:

    (toStringList(%{10437}) UNION toStringList(%{10438}))
    EXCEPT
    (toStringList(previousValue(%{10437}), ",") UNION toStringList(previousValue(%{10438}), ","))
    

    You can also use the following seed string expression:

    filterByPredicate(toStringList(%{10437}) UNION toStringList(%{10438}), ^% not in toString(fieldValue(%{00000}, subtasks())))
    
  5. Log in to comment