Menu

create a query of all worked { opened, updated, closed ,etc) items between dates.

2016-03-18
2016-04-01
  • Randall Edo. Badilla Castro

    Hi people:
    I'm trying to work out a query that pickup all worked items (request, problems, changes and incidents) that an agent
    worked on (open, close, update and solved) between dates (1st of the month and the last of the month).
    I will left that query to make monthly reports of all activity made by agents.
    Since there are incidents or problems that are updated but not closed/resolved (since resolutions depends of other teams) the basic query don't fit well.
    I ask for some help since I'm not good with sql queries.
    Thanks!

     
  • Randall Edo. Badilla Castro

    so far SELECT UserRequest
    WHERE
    start_date > '2016-02-01 00:00:00'
    AND
    last_update < '2016-03-08 00:00:00'
    UNION
    SELECT Incident
    WHERE
    start_date > '2016-02-01 00:00:00'
    AND
    last_update < '2016-03-08 00:00:00'
    UNION
    SELECT Problem
    WHERE
    start_date > '2016-02-01 00:00:00'
    AND
    last_update < '2016-03-08 00:00:00'
    UNION
    SELECT Change
    WHERE
    start_date > '2016-02-01 00:00:00'
    AND
    last_update < '2016-03-08 00:00:00'

    gave a very close view of what I need.

     
  • Ilias Hassar

    Ilias Hassar - 2016-04-01

    Identifiy all the relation betwen this classes( objects) and then perform a Query with JOIN statement but don´t forget to use the correct order start joining classes with less dependencies to the one wich has most.

    I don´t work with incidents, problems or change only cdmb so I don´t know how to the datamodel works. But you can check it on datamodel page of your itop instalation.

     

Log in to post a comment.