Date time information saved in Jira Database for transitions

Mehak Aggarwal March 22, 2019

Hi All,

I have created an issue in Jira.Based on the date and time the Created Field is updated.This field takes system date and time.

Now I am updating the issue from one status to another and in the transitions I can see both Date and time are displayed.

I am trying to search for this issue in my Jira Database JiraIssue table and changegroup table, when I see the created column the data has only date information.It does not contains time information.

Could you please help me if this information is saved somewhere in database or direct to correct database tables or a way to retrieve this date and time information from database.

 

2 answers

0 votes
MR2001 January 7, 2021

I know it's late, as the posting is from 2019, but I can provide an answer (I experienced the same issue).

Just run this command before running the SELECT query and you will see date and time information for [Created] field:

alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';

Regards,

M. R.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2019

Created date and time is stored in the jiraissue table, and all changes to an issue are logged in changegroup.  Both fields used for storing when the action was taken are date/time fields and capture both date and time.

What tool are you using to read the database?  It sounds like the tool is set to ignore time stamps in date columns!

Mehak Aggarwal March 25, 2019

I am using Jira version 7.9 in production and 7.11 in test environment and using SQL database to retrieve the data .

Query used to fetch data is below:select row_number() over (PARTITION BY JI.ID order by CG.CREATED asc) row#,JI.ISSUENUM as ID,
CI.OLDSTRING as FromStatus, CI.NEWSTRING as ToStatus,
JI.CREATED as CREATED,CG.CREATED as EXECUTED
from jiraissue JI
join changegroup CG on CG.issueid = JI.ID
join changeitem CI on CI.groupid=CG.id and field = 'status'
LEFT JOIN nodeassociation X ON X.SOURCE_NODE_ID = ji.ID and X.ASSOCIATION_TYPE = 'IssueFixVersion'
LEFT JOIN projectversion Y ON Y.ID = X.SINK_NODE_ID
JOIN project ON project.ID = ji.PROJECT AND project.id =
JOIN issuestatus s ON ji.issuestatus = s.ID
where JI.CREATED>'01-JAN-18' and JI.ISSUETYPE=

Attached is the screenshot from history tab that shows the data and time format for each transition change.

Also attached is the JIRAISSUE Database structure that shows that 'CREATED','UPDATED' column has data type as DATE.

Was this changed in the recent releases?

Is there some other table which I could join to my query to retrieve details related to date and time both?Jiraissue_Databasetable.pngTransition Date and time.png

Mehak Aggarwal March 28, 2019

Is there some update on the issue?

Thanks,

Mehak

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2019

>Was this changed in the recent releases?

No, it has not changed since Jira 1

>Is there some other table which I could join to my query to retrieve details related to date and time both?

No, because, as I said before, the data is stored in the tables you are reading, and there is no reason to duplicate it elsewhere.  The date and time you are pointing to in the change history in your screenshot is the date/time stored in the changegroup date/time field.

I do not know why your database tool is suppressing the time display.  Mine does not.  A changegroup in my Jira (was 7.6, now 8.0) looks like this:

Screenshot 2019-03-28 at 10.39.52.png

Suggest an answer

Log in or Sign up to answer