Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Using page include from the support KB space to avoid duplicate pages
Table of Contents
maxLevel2
minLevel2
typeflat
separatorpipe

Description

JIRA records all changes to issues in the change log and other tables. There currently is no remote API to access these changes, but you can query the JIRA tables (read only!) to get the information. This can be used to feed into external systems either using the JIRA CLI (an external JIRA system) or other applications. If going to another JIRA, the runFromSql action can be used directly from these queries. Your script will need to keep track of time intervals to ensure all changes are selected only once. One technique is to let your database generate a specific timestamp, save this in a table so it is available across script shutdowns, and then us it for all the queries. Repeat.

New issues

...


select 
    pkey,
    issuetype,   -- you may want conditions on this in the where clause or script logic
    issuestatus, -- you may want conditions on this in the where clause or script logic
    from jiraissue 
    where created > '${sinceTimestamp}' and created <= '${endTimestamp}'
    order by created asc

Changed issues

...


select 
    ji.pkey as pkey, 
    ji.issuetype as issuetype, 
    ji.issuestatus as issuestatus,
    cg.created as created, 
    cg.author as author,
    ci.field as field, 
    ci.fieldtype as fieldtype, 
    ci.oldstring as oldstring,

    from changegroup as cg
    join jiraissue ji on cg.issueid = ji.id
    join changeitem ci on ci.groupid = cg.id
    where cg.created > '${sinceTimestamp}' and cg.created <= '${endTimestamp}'
    order by cg.created asc

Comment changes

...

Include Page
SUPPORTS:How to discover JIRA changes
SUPPORTS:How to discover JIRA changes