Rally Software

Expand all | Collapse all

How do I query for a list of User Stories that have attachments?

  • 1.  How do I query for a list of User Stories that have attachments?

    Posted Mar 31, 2015 11:41 AM
    I'd like to view the user stories in my backlog that have attachments.   There doesn't appear a way to do this using a custom view or a custom grid.  

    Can this be done by using a query perhaps?


  • 2.  Re: How do I query for a list of User Stories that have attachments?
    Best Answer

    Posted Mar 31, 2015 12:44 PM
    Hi Miea, there's not a great way to query for those stories, but you might try implementing this custom, unsupported app via a Custom HTML app on your dashboard / custom page: https://github.com/markwilliams970/Artifacts-With-Attachments

    Here's how to implement a custom app: Deploy a Rally Catalog or Custom app from HTML source


  • 3.  Re: How do I query for a list of User Stories that have attachments?

    Posted Nov 15, 2018 01:02 PM

    Is there still no way of querying stories with attachments?

     

    I tried using the WSAPI documentation for this and it doesn't work. 

     

    Is there a reason why? I was assuming that if something was in the WSAPI doc then it can be queried upon (unless it mentions so in the document itself for the field). 

     

    How do I identify such fields then?

     

    Regards,

    Niveditha



  • 4.  Re: How do I query for a list of User Stories that have attachments?

    Broadcom Employee
    Posted Nov 15, 2018 01:37 PM

    Hi Niveditha,

     

    You can use WSAPI to find User Stories that have attachments.

    Here is a query that you can apply to the Custom List app that will filter only user stories that have attachments and are in the backlog.

     

    The part of: (Attachments.ObjectID != null)    is how you filter for attachments. You can also use:  (Attachments.ObjectID > 0)

     

     

    Let us know if this helped.

     

    Sagi



  • 5.  Re: How do I query for a list of User Stories that have attachments?

    Posted Nov 15, 2018 02:00 PM

    Ahh! Thank you Sagi!

     

    I did not think of ObjectID.

     

    Regards,

    Niveditha



  • 6.  Re: How do I query for a list of User Stories that have attachments?

    Posted Nov 15, 2018 02:01 PM

    Also, how do I extract the attachment name and attachment descriptions?

     

    Will it be Attachments.Name and Attachments.Description ?

     

    Regards,

    Niveditha



  • 7.  Re: How do I query for a list of User Stories that have attachments?

    Broadcom Employee
    Posted Nov 15, 2018 04:01 PM

    Hi Niveditha,

     

    You won't be able to make a reference such as: Attachments.Name or Attachments.Description. The reason is that the 'Attachments' is a collection object. That object doesn't have a 'Name' or a 'Description'. These fields belong to the each of the internal items inside the collection. You will need to extract each actual Attachment item from the collection, then make a reference to the Name or Description field.

     

    So, you'll need to call the Attachments _ref field which holds the URL of that collection. This will return the collection object along with total result count , then you can iterate or further filter on the items inside.

     

    Sagi



  • 8.  Re: How do I query for a list of User Stories that have attachments?

    Posted Nov 15, 2018 04:13 PM

    Hey Sagi,

     

    Okay, I think I understand what you mean. So if I have to extract information about all attachments from a story (attachment name, description etc), how do I do it?

     

    How do I do the Attachments_ref field?

     

    Regards,

    Niveditha



  • 9.  Re: How do I query for a list of User Stories that have attachments?

    Broadcom Employee
    Posted Nov 15, 2018 04:28 PM

    It will be more difficult to get to the individual attachment by the collection, unless you use the SDK or some ToolKit (like Java or .NET) that will allow you to examine and iterate over the collection objects.

     

    So my suggestion is this:

    1. You can use the query I sent you earlier to find all user stories in backlog that have attachments. 

     

    2. Then, for any such user story (which you know the Name) you can use the Attachment endpoint and filter by the Artifact field such as: (Artifact.Name = "Your User Story Name") . This will return all individual attachments of that particular user story where you can fetch the Name, Description, ContentType etc..

     

    Check out the 'Attachment' endpoint and see it's field called: Artifact. That will probably be the easiest way to get it all done.

     

    So, in step 1 you find all your user stories, then one-by-one you query the Attachment endpoint for each such story and get the info on its attachments.

     

    Let me know if helped.

    Sagi



  • 10.  Re: How do I query for a list of User Stories that have attachments?

    Posted Mar 31, 2015 01:12 PM
    This worked PERFECTLY!  Thank you SO very much.


  • 11.  Re: How do I query for a list of User Stories that have attachments?

    Posted Mar 31, 2015 01:21 PM
    Oh cool!  Good to hear!


  • 12.  Re: How do I query for a list of User Stories that have attachments?

    Posted Jun 16, 2015 01:50 AM

    I tired this and was able to attach said custom app without error. But this is not working for me... it shows some random numbers as result (not the story id's etc). 
    Is there any other dependancy of this app? like browser etc?