Rally Software

Expand all | Collapse all

How to get all the tasks and its respective titles of user story?

  • 1.  How to get all the tasks and its respective titles of user story?

    Broadcom Employee
    Posted Jun 19, 2018 02:29 AM

    When i am trying to get all the tasks in the user story

    I am getting summary of tasks but not detailed information of each task and its respective title



  • 2.  Re: How to get all the tasks and its respective titles of user story?

    Posted Jun 19, 2018 02:57 AM

    Satya,

     

    Would you be able to elaborate a bit more on what you are seeing or trying to do?

     

    Michael



  • 3.  Re: How to get all the tasks and its respective titles of user story?

    Broadcom Employee
    Posted Jun 19, 2018 05:24 AM

    Hi Michael,

     

    I am passing userstory to restapi and trying to fetch task details by passing the userstory as shown below

     

    const queryStatement = queryUtils.where('FormattedID', '=', UserStory);

    restApi.query({

            type: 'hierarchicalrequirement',

            fetch: 'Tasks:summary[FormattedID;Name;State;Owner]',

            query: queryStatement,

            scope: {

                workspace: '/workspace/ workspaceid,

            },

        },

     

    But this is resulting string of formatID’s and Names but not like array.

     

    Getting data like below:

    1. {_rallyAPIMajor"2"_rallyAPIMinor"0"_ref"https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/198339838176"_refObjectUUID"0fad95a2-3339-4e50-8273-1d007b75ee40"_objectVersion"95", â€¦}
    2. 1. Summary:
       1. Tasks:
              1. Count:19
              2. FormattedID:{TA1080282: 1, TA1080287: 1, TA1052207: 1, TA1068583: 1, TA998275: 1, …}
              3. Name:{Talk to UX for accessible code component: 1, Talk to UX team for workviews page: 1, Get trained on                 A11y guidelines: 1, Talk to UX team for workviews page accessibility review May 11: 1, Have discussion                   with UX team in ITC: 2, …}
                4. Owner:{-- No Entry --: 19}
               5. State:{In-Progress: 10, Completed: 1, Defined: 8}
              6. __proto__:Object
             
    3. Buy parsing the above json it is tough to get task id and its respective name. because it is giving summary of tasks. Whereas FormattID and Name are strings.

      But I wanted to get the every task ID and it details in JSON format.



  • 4.  Re: How to get all the tasks and its respective titles of user story?

    Posted Jun 19, 2018 07:21 AM

    Satya,

     

    You are using the "Summary" function, so it only provides the Summary count information as described in the Summaries section here:

     

    https://rally1.rallydev.com/slm/doc/webservice/rest_collections.jsp 

     

    You can fetch the Tasks Array Object:

     

    fetch: Tasks

     

    And then you can fetch the Task collection which has all that information.

     

    Michael



  • 5.  Re: How to get all the tasks and its respective titles of user story?

    Posted Jun 19, 2018 10:39 AM

    morky01 or corkr03,

     

    Is there a one shot way to do this or is it grabbing the Tasks Ref for the collection and then getting the Tasks?

     

    Michael



  • 6.  Re: How to get all the tasks and its respective titles of user story?

    Broadcom Employee
    Posted Jun 20, 2018 04:58 AM

    Hi Michel 

     

    fetch: Tasks also not giving the all the task details. it is giving reference (_ref) to the those tasks.

    when i browse that tasks reference url, i am getting the json data of tasks only in that story.

     

     

    when i query the api programatically with this reference (_ref).  i am getting all the tasks but not the tasks only in that userstory.

     

    below code is returning all the tasks in that project. What changes should i do to get task present in particular user story.

    please help

     

    restApi.query({
    type: 'task',
    fetch: ['FormattedID', 'Name'],
    scope: {
    workspace: '/workspace/25194919975',
    },
    }, function(error, result) {
    if (error) {
    console.log(error);
    return res.json('');
    }
    else{
    return res.json(result.Results);
    }
    });


  • 7.  RE: Re: How to get all the tasks and its respective titles of user story?

    Posted Aug 11, 2020 12:45 PM
    Hi Satya, Hi everyone,

    I am trying to fetch a summary which returns a hydrated field from a DefectSuite.

    e.g.:
    1 DefectSuite has a Collection of Defects (and each defect has a set of Fields).

    My current fetch query is:
    fetch: ...,Defects:summary[FormattedID;Release]

    Where, Release is a "Release Object" (I need the field "Name" from it), however, I am getting just the _ref value for the object.



    Is there anything like like:
    fetch: ...,Defects:summary[FormattedID;Release.Name]

    Thanks!



  • 8.  Re: How to get all the tasks and its respective titles of user story?

    Posted Jun 20, 2018 05:09 AM

    Satya,

     

    Perhaps it is better to start from scratch on this question.  What exactly are you trying to accomplish with your code?  If you can provide your end goal, it may be easier to help.

     

     

    Michael



  • 9.  Re: How to get all the tasks and its respective titles of user story?

    Broadcom Employee
    Posted Jun 20, 2018 05:14 AM

    HI Michel

     

    I wanted to get list of all task and it's details in a user-story using rest api

     

    Satya



  • 10.  Re: How to get all the tasks and its respective titles of user story?
    Best Answer

    Posted Jun 20, 2018 05:52 AM

    OK,

     

    Does this work as you expect?

     

    const queryStatement = queryUtils.where('Workproduct.FormattedID', '=', UserStory);

     

    restApi.query({
    type: 'task',
    fetch: ['FormattedID', 'Name'],
    query: queryStatement,
    scope: {
    workspace: '/workspace/25194919975',
    },
    }, function(error, result) {
    if (error) {
    console.log(error);
    return res.json('');
    }
    else{
    return res.json(result.Results);
    }
    });


  • 11.  Re: How to get all the tasks and its respective titles of user story?

    Broadcom Employee
    Posted Jun 20, 2018 07:46 AM

    Thank you Michael, it's working.

    could you please provide me with some references to work with rally api.



  • 12.  Re: How to get all the tasks and its respective titles of user story?

    Posted Jun 20, 2018 08:18 AM

    Satya,

     

    Great, I am glad that got it.

     

    The Web Services API documentation is great.  It shows you all the Artifacts and even allows you to test queries.

     

    https://rally1.rallydev.com/slm/doc/webservice/ 

     

    You can browse GitHub for samples of apps that have been built:

     

    Rally Technical Services Team · GitHub 

    Rally Software Apps · GitHub 

    CA Technologies (formerly Rally) · GitHub 

    Rally Software Tools · GitHub 

     

    Stackoverflow for questions that have been asked by others:

     

    Newest 'rally' Questions - Stack Overflow 

     

    The Developer section of the Help Documentation:

     

    For Developers | CA Agile Central Help 

    Agile Central App SDK 2.1 Docs 

     

    There are even some videos on YouTube about building apps:

     

    Building Rally Apps - Intro & Kickstart - YouTube 

     

    Hope those help get you going.

     

    Michael