JQL result is incorrect

Issue #402 resolved
Michael shechter created an issue

Hi, i got two fields called user destination and user source.some times the value of the filed can be null. i want to show on issue, all issues that user source and user destination are the reporter on two other project. i created post funcation with Read field from issues returned by JQL query to get all the relevant issues . it works well i got a value but if i dont have a value on user destination or user source. i got worng value. i excepted to got null on the jql query.

on the end of the transtion i clean the fileds: USERD-SD,USERD-SEEV,USERS-SD,USERS-SEEV.

please see screenshot 1: you can see the jql query "%{15855}"=user destination screenshot 2: the all transtion. screenshot 3: you can see a issue that have a value only on user destionation and i also got a value on user source.

what i did worg ? how can i fix it ? thank you

Comments (8)

  1. Fidel Castro Armario repo owner

    Hi Michael,

    I can't reproduce your problem. The only cause I can imagine for your problem is that fields USERS-SD and USERS-SEEV are already set when you execute the transition, and since post-function "Read field from issues returned by JQL query" is writing nothing, the previous values of those fields are kept and used in the text composition used for setting field "user source fields" custom field.

    There are various solutions for your problem, but I recommend you to try the following one:

    In your post-functions, replace USERD-SD and USERS-SD custom fields with Ephemeral string 1 viitual field , and replace USERD-SEEV and USERS-SEED custom fields with Ephemeral string 2 virtual field.

    You should also remove the 4 post-functions for purging fields USERD-SD, USERS-SD, USERD-SEEV and USERS-SEED, since Ephemeral string 1 and Ephemeral string 2 are purged automatically at the end of the transition.

    Please, let me know if it solves your problem.

  2. Michael shechter reporter

    hi fidel, i changed the post funcation as your recommendation (see screenshot4). i still got wrong jql result. it seems that i get all issues in the project SD with closed status. when i limit the JQL query to "status in (open, in proggres)" i didnt get any result. you can see in the attached log that the user destanation in null (line 21). can i create a Boolean expressions in "Read field from issues returned by JQL query " that if the user destanation or user source in null dont run the JQL (post funcation number 2,3,5,6) or craete a new post funcation that Check if the user destanation or user source in null and skip post funcation number 2,3,5,6 if its true.

  3. Fidel Castro Armario repo owner

    The simplest solution is to set parameter Conditional execution, available in all the post-function since version 2.2.9, with a boolean expression like:

    %{nnnnn} != null
    

    replacing nnnnn with field code for user destination in post-functions 2, 3 and 4 and for user source in post-functions 5, 6 and 7.

    If you can't update your version of the plugin, there is an alternative solution, but much less intuitive.

  4. Log in to comment