JQL for Sprint name starting with a character - jql

I am trying to retrieve the Sprint name that starts with character 'v' of a certain project.
So far i have this jql query:
Sprint in closedSprints() AND Sprint = v AND project = [my_project_name] ORDER BY Sprint DESC
However, even tho' it looks like "Sprint=v" works, it does not. No filtering is done. Can you help with a different approach?

Related

Jira Software 7.1.2 - Sprint ID from AO_60DB71_SPRINT does not match the IDs on CustomFieldValue

I'm currently on a project where I need to develop some analysis using the Jira Software database. We have Jira 7.1.2, and it is installed on Oracle.
I did some research and found out that the Sprint ID from the table AO_60DB71_RAPIDVIEW should be found on the table customfieldvalue (field stringvalue) so that I can join issues with sprints.
However, although the IDs I get from customfieldvalue match the ones I get from Jira UI, they do not match the ones on AO_60DB71_RAPIDVIEW (hence making it impossible for me to join issues with sprints for my dashboards).
Does anyone know how can I solve that, please?
Also, I know that the sprint is with different IDs on the two tables because I have its name on both of them (fields Name on AO_60DB71_RAPIDVIEW and NewString on customfieldvalue).
Thanks so much in advance!

Jira: Status of all tickets at a certain point in time

I want to pull out month-by-month stats from a jira project, which shows the number of tickets that were in each state at the start of each month (similar to the Cummulative Flow Diagram, but extractable).
Is there a way in JQL or SQL to get the status of all tickets in a project at a specific point in time?
If you want to do this via SQL for one specific date, Atlassian provides instructions for related useful queries on JIRA 4.x. A particularly-relevant one would seem to be the "Find Statuses of all issues in a project on a given date" query, but it will be a bit of an uphill battle to do this over a varying date range.
These queries are still mostly relevant for more modern versions of JIRA, with the main concern being that the JI.pkey column will be blank in JIRA 6+. To get this data back, you first need to join with the project table with ON project.id=JI.project, and then synthesize the issue key yourself as P.pkey || '-' || JI.issuenum. You will also probably need to apply typecasts to some of the joins (at least on some databases) since a few joins are trying to relate integer-typed columns with text columns.
For reference, their JIRA 4.x query was the following:
SELECT JI.pkey, STEP.STEP_ID
FROM (SELECT STEP_ID, ENTRY_ID
FROM OS_CURRENTSTEP
WHERE OS_CURRENTSTEP.START_DATE < '<your date>'
UNION SELECT STEP_ID, ENTRY_ID
FROM OS_HISTORYSTEP
WHERE OS_HISTORYSTEP.START_DATE < '<your date>'
AND OS_HISTORYSTEP.FINISH_DATE > '<your date>' ) As STEP,
(SELECT changeitem.OLDVALUE AS VAL, changegroup.ISSUEID AS ISSID
FROM changegroup, changeitem
WHERE changeitem.FIELD = 'Workflow'
AND changeitem.GROUPID = changegroup.ID
UNION SELECT jiraissue.WORKFLOW_ID AS VAL, jiraissue.id as ISSID
FROM jiraissue) As VALID,
jiraissue as JI
WHERE STEP.ENTRY_ID = VALID.VAL
AND VALID.ISSID = JI.id
AND JI.project = <proj_id>;
If you are open to using a commercial add-on, Arsenale Dataplane can do exactly what you want in a few clicks using the Issue Values Snapshots by Date report. Disclaimer: I work for the company that makes this product.
With JQL you can only look for Issues not for States. About the specific point of time, you can only get information about the current status, unless you develop a complex script that takes in account the current situation and the changes made after the date you want to check (ChangeHistoryManager).
On the other hand, you can configure a Board with a pie chart (in example), where you set the Status field to be shown. Additionaly, you can create a Notification so that each first of month you get an email with this information.
Probably more interesting the scripting solution, but absolutely longer in time, and more complex.
Regards

JQL filter matching backlog including order

I need a JQL filter that matches what's in the backlog, and have the same order as the backlog.
My product owner and I ordered all the backlog, and I need my filter to reflect that.
My current attempt has about five and a half times as many items as the backlog...900 vs 159 actual items in the backlog
project="Project Name" AND issuetype != Epic AND (Sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) and status != Closed Order by RANK
The order isn't correct either.
How do I filter items to match what the backlog has, and show the same order?
If you check the configuration of your board, it will have a few Filter settings that specify which issues have to be displayed on your board and backlog. Documentation is available here. The screen looks like this:
With the contents of the Saved Filter and Filter Query fields you should be able to build the JQL query that matches your backlog. The Ranking field specifies how issues are ordered, but typically this is done by their Rank, which you already use in your JQL. You can add ASC or DESC to change the direction of the order, ie. ORDER BY RANK DESC.
These rules determine which issues are visible in the backlog for your board:
An issue will only be visible in the Backlog if:
the issue is not a Sub-Task,
the issue matches the board's Saved Filter (see Configuring Filters),
the issue's status maps to one of the board's columns (but not the 'Done' column), and
there is at least a status being mapped to the right most column. Eg. If you have the columns To Do, In Progress , and Done, ensure that you have a status mapped to In Progress at least. If you map all the statuses to the first column (To Do), you will not be able to see any issues in the Backlog.
This is taken from this documentation page.
Here is the answer that worked for me
project = <your project> AND issuetype in (task, "Task ", Story, Improvement, Improvements, Research, Bug, Incident) AND status not in
(Done, CANCELLED, Closed) AND (Sprint in (futureSprints()) OR Sprint
is EMPTY) ORDER BY rank
Changed the parameters according to your project.
Order by rank - gives you the order you see in the backlog
Cheers

SQL stored procedure with 3 tables

I have the following tables linked here: tables.
What I have is here: procedure.
I need to list all projects and tasks belonging to a given customer (customer number given as a parameter). At the beginning of the report show the customer name followed by the first project, displaying the project and name. For each project display beneath it the task number (in ascending order), description, hours and start date. Follow the last task with the customer’s total number of tasks and project charges then do the same for each subsequent project for the customer. At the end of the report, give the total number of hours for that all the tasks, as well as how many projects and tasks were reported.
I'm not really sure how procedures work so any help is appreciated. Thank you!
The nextproject cursor has no relationship defined between TASK and either of the other tables used in the cursor, so every row in TASK is being joined to all the valid combinations of PROJECT and CUSTOMER. This is known as a "Cartesian join" and is probably not what you had in mind. To correct this you need modify the cursor slightly:
cursor nextproject is
select p.pjno, c.custname, t.taskno, t.descrip, t.hrs, t.start_date
from task T, project P, customer C
where C.custno = P.custno and
p.custno = custnum
AND t.pjno = p.pjno; -- ADDED
This may or may not fix all your problems, but it should move you along with this assignment.
SQLFiddle here for those who care to take a stab at it.
Share and enjoy.

Trying to get the first record for each day of the week in Rails via SQL if possible

I have a weekly view of projects. For each project I'm grabbing the first record for each day of the week. It's important to me to always get the first record for that day, and know which weekdays have no records. Right now I'm doing this with a separate SQL string for each project + day of week combo in a nested for loop.
This feels wrong. It seems like I should be able to get this with ActiveRecord / SQL via Group By and Limit, and use Ruby/Rails to process the results. Is this possible?
Thanks in advance.
– David
Does that do the job? (Using MySQL)
#projects = []
for day in 1..7
#projects.push Project.where("DAYOFWEEK(project_date) = ?", day).where(:project_date => Time.now.all_week).order('project_date desc').first
end
#Time.now.all_week assumes you're working with Rails 3.2
Take a look at DATEOFWEEK() in MySQL docs
You can test with
for pj in #project
p pj.project_date if pj.project_date #nil if no project found
end