Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SQL request for jira issues moved from my project

Fedorov Fedor July 24, 2018

Hello,

How SQL request I must write for jira issues moved from my project?

I was install plagin NFeed, and want to write in the Query-SQL script or maybe JQL request if is possible - for moved issues from project (key = KSP)

2 answers

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2018

There is a table with a pretty obvious name - it is something like moved_issues (but don't quote my memory on that)

You'll find it has "old issue key" (the project-sequence key the humans use) then "issue id" (The unique immutable key in the database that does not change when you move the issue to another project)

Fedorov Fedor July 25, 2018

In general, the user set a task, write a Filter that will show the number of issues moved from our project to anywhere, for a week from 00.00 on Monday.

But I can't find in JQL filter this function with - show the number of issues moved

And write this SQL script in the plagin NFeed

Select project.pkey + '-' + cast(jiraissue.issuenum as varchar(20)) as issueKeyForJQL , jiraissue.issuenum , changeitem.* from jiraissue join project on jiraissue.PROJECT = project.ID join changegroup join changeitem on changegroup.ID = changeitem.groupid on jiraissue.ID = changegroup.issueid where project.pkey = 'KSP

Fedorov Fedor July 25, 2018

But I must write jql filter for user...And dont understand how. 

I think i must write my custom function, for moved issues  ?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2018

You are correct, you will need a custom function for that.  Annoyingly, Jira has a "issue was ..." search function, but it does not yet support "project", so you can not yet issue searches like "Project was xyz"

Do you have any of the scripting add-ons?  Or would you be aiming to write a JQL function as an add-on for yourself?

Fedorov Fedor July 25, 2018

In our JIra system we using Script Runner, nFeed plugin. 

I must write this filter -- Filter that will show the number of issues moved from our project to anywhere, for a week from 00.00 on Monday.

But in JQL cant find some function in our system

This Filter will be used our Project Manager for filtering issues...

0 votes
Jack Brickey
Community Champion
July 24, 2018

Not a direct answer but here are my thoughts FWIW.

Not sure about SQL but you can't get there via JQL AFAIK. The previous issue key will be stored in the history and you might consider writing a listener for moves and storing the old  key in a custom field. Then you can search for not empty on that field. You can also achieve via Scriptrunner I expect.

Fedorov Fedor July 25, 2018

Sorry, but I dont know how write listener(((

I dont know groovy and java(((

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events