Rally Software

  • 1.  Empty the custom drop down list thru Rally API

    Posted Oct 12, 2018 02:15 PM

    How can I remove all the values (empty it) of a custom drop down list through the Rally API? I do not see an objectid associated with each value as a drop down list (multi value )



  • 2.  Re: Empty the custom drop down list thru Rally API
    Best Answer

    Broadcom Employee
    Posted Oct 12, 2018 03:22 PM

    Hi Ritu,

    There isn't a way to do that using the API.

     

    The attribute values (the list of drop-down values) is stored under the AttributeDefinition . Here is the allowed operations on that endpoint:

     

     

    The drop-down values is stored under the 'AllowedValues' field:

     

     

    You may attempt to update the attribute definition and clear out the 'AllowedValues' field, but you will encounter this error indicating you can only use the GET method to read values, not to update:

     

     

    I hope this helps.

     

    Sagi



  • 3.  Re: Empty the custom drop down list thru Rally API

    Broadcom Employee
    Posted Oct 12, 2018 03:40 PM

    Notice the 'Collection Modifiable = no' in the 'AllowedValues' field. This is the indicator that you can't modify the values.

     

    I believe the reason behind it is that artifacts may already exist and reference these values, so deleting them will leave dangling references behind. 

     

    Sagi



  • 4.  Re: Empty the custom drop down list thru Rally API

    Posted Oct 12, 2018 03:42 PM

    So there is no way around to get this list emptied using the API ?



  • 5.  Re: Empty the custom drop down list thru Rally API

    Posted Oct 12, 2018 03:45 PM

    I am able to delete the values from the UI and add them again. I did my research on the test box.

    I am also able to delete the multi-value drop down list using API and create them again.



  • 6.  Re: Empty the custom drop down list thru Rally API

    Broadcom Employee
    Posted Oct 12, 2018 04:18 PM

    Hi Ritu,

     

    In my tests I can't find a way to delete the values. I tried both using POST to update the AttributeDefinition and unset the AllowedValues (which is what I shared earlier). I also tried using the http DELETE method on the AllowedValues directly. Both are not working.

     

    Let me be sure I understand your question: You are asking how to delete the values from a drop-down so that they are out of the field entirely and disappear from any usage of that field and any artifact instance, correct?

     

    With regard to that you can change it from the UI:

    Yes, you're correct. You can do that. I can learn more from Engineering on why the difference between the UI and the API, but there does seem to be a difference.

     

    You mentioned you were able to use the API to delete the multi-valued drop-down list. Can you share more on how you got this done?

     

    Thanks,

    Sagi



  • 7.  Re: Empty the custom drop down list thru Rally API

    Posted Oct 13, 2018 12:25 AM

    Using the API to delete the multi-valued drop-down list:

     

    string AD = "https://rally1.rallydev.com/slm/webservice/v2.0/allowedattributevalue/" + strobject[i];--strObject is the objected of one of the value in the multiselect drop down list.
     rallyApi.Delete(AD);
                         



  • 8.  Re: Empty the custom drop down list thru Rally API

    Posted Oct 15, 2018 10:11 AM

    Also I have another question, is there a method to sort the drop-down list in some way ?



  • 9.  Re: Empty the custom drop down list thru Rally API

    Broadcom Employee
    Posted Oct 18, 2018 01:24 PM

    Hi Ritu,

    My apologies for the late reply:

     

    - About your question on sorting the drop-down list:

    I don't see an option to sort it. I think it may be a good enhancement request (at: https:ideas.rallydev.com) 

     

    - About your example on the multi-valued drop-down list (your reply from 10.13): 

    Is that an example using our Java Toolkit?

     

    Sagi