DB Table for Change History - Copy Parsed data to CF Postfunction

Issue #55 resolved
Rahul K created an issue

Hi,

Does the postfunction for Copy parsed data to a Select List Custom field not save the Change History in the CHANGEITEM and CHANGEGROUP tables? Where can I find the change history for such changes made via post-functions?

-Rahul

Comments (12)

  1. Fidel Castro Armario repo owner

    Hi Rahul,

    Changes are registered in issue's History tab, and you can see them as changes made by editing the issue manually. I have made a demonstration using JIRA 5.0 and version 2.1.3 of JIRA Workflow Toolbox.

    I have attached the screenshot of the transition configuration, and the screenshot of History tab with the changes made by post-function "Copy parsed text to a field".

    Custom field "Colour" is a Select List initialized to value "green" and changed by post-funtion "Copy parsed text to a field" to "red":

    Transition configuration: Copy parsed text configuration.png

    Changes in History tab: Captura de pantalla 2014-07-07 a la(s) 12.30.20.png

    I made changes in the way custom fields are written in version 2.1.16 of the plugin. Have you tried most recent version of the plugin 2.1.19 to see if it solves your problem?

    Have you checked server's log file to see if the plugin is writing any error message?

  2. Rahul K reporter

    Hi Fidel,

    Thanks for your response. I know about the way this plugin works and the details being shown in the History tab. What I am looking for is the entire change history of a custom field which I can access directly from my Oracle database. Normally the change history is saved in the CHANGEITEM and CHANGEGROUP tables. For the Custom field which I update using this plugin, the change history is not being saved in the Oracle DB tables. I was wondering if it saves it at all.

    Regards, Rahul

  3. Fidel Castro Armario repo owner

    Hi Rahul,

    I have done the following test using JIRA 6.2.7 with a HSQLDB database and JIRA Workflow Toolbox 2.1.19:

    1.- I have used post-function "Copy parsed text to a field" to set a Select List custom field called "City". I have used the following configuration:

    Copy parsed text to a field configuration.png

    2.- Then I have launched the following SQL query on JIRA database:

    SELECT ID, GROUPID, FIELDTYPE, FIELD, OLDVALUE, OLDSTRING, NEWVALUE, NEWSTRING FROM CHANGEITEM WHERE GROUPID IN (SELECT ID FROM CHANGEGROUP WHERE CREATED > '2014-07-07 18:00:00');

    And I could see that it correctly registered the value change of field City made by post-function "Copy parsed text to a field", as you can see in the following screenshot:

    CHANGEITEM_DUMP_SELECT_LIST.png

    I can't imagine that JIRA doesn't register into Oracle Databases custom field value changes made by post-functions. Isn't it possible that you have some kind of error in your SQL query on database CHANGEITEM?

  4. Rahul K reporter

    Hi Fidel,

    I am using a query to directly search for change items for a specific JIRA Issue:

    select JI.ID,JI.PKEY,CI.field, CI.OLDSTRING, CI.NEWSTRING FROM CHANGEITEM CI, CHANGEGROUP CG, JIRAISSUE JI WHERE CI.GROUPID = CG.ID AND CG.ISSUEID = JI.ID and JI.PKEY = 'ABC-1234'

    This only gave me changes made to the Status, assignee, etc. It did not give me the change made for the custom field select list in the Post Function

    I even tried a query similar to yours: SELECT ID, GROUPID, FIELDTYPE, FIELD, OLDVALUE, OLDSTRING, NEWVALUE, NEWSTRING FROM CHANGEITEM WHERE GROUPID IN (SELECT ID FROM CHANGEGROUP WHERE CREATED > to_date ('09-07-2014', 'DD/MM/YYYY')); This also gave me the same data, without the Custom field select list which is set via the Pust Function.

    I am attaching the screenshots of the PostFunction

    -Rahul

  5. Rahul K reporter

    Hi Fidel,

    I just realized that though the Post Function works correctly and the value of the Select List is changed, I do not see any change in the History tab of the JIRA issue. It just shows the Status change because of the transition. You had attached the History tab screenshot in your earlier comment.

    Any ideas why?

  6. Fidel Castro Armario repo owner

    The problem is due to a bug in JIRA API used in that version of JIRA Workflow Toolbox for updating custom fields. It was fixed in version 2.1.16. I strongly recommend you to update the version of the plugin, since current version (2.1.19) fixes many bugs and provides many improvements.

    Anyway, you can use the following workaround: do two consecutive writings on the custom field you want to update. If you must set more than one custom field, you only have to use the workaround for the first custom field. I show you an example:

    Workaround.png

    Please, close the issue if your problem is solved.

  7. Rahul K reporter

    Thanks for the details. I tried the workaround you suggested but that too did not work out. I added an extra step to copy the same value to the first custom field in the Postfunction. But that did not work. I tried to interchange their positions and also added a duplicate for the 2nd custom field as well (PostFunction3.jpg attached)

    Anything I am missing? I will check with our System owners if we can upgrade the plugin version.

  8. Fidel Castro Armario repo owner

    Which version of JIRA are you using?

    The problem doesn't happen in JIRA 5.0, but I have been able to reproduce it in JIRA 6.2.7. The duplicated writing workaround is valid in JIRA 6.2.7, but maybe not in your version.

    The new way of writing on custom fields used from version 2.1.16 isn't affected by this problem.

  9. Fidel Castro Armario repo owner

    I have managed to reproduce the problem in version 5.1.8, and that the workaround is not valid for that version of JIRA.

    I can also confirm that version 2.1.19 of JIRA Workflow Toolbox fixes the problem.

  10. Rahul K reporter

    Thanks for the verification Fidel! I guess the only option I have is to upgrade the plugin version. You can close this ticket.

  11. Log in to comment