Rally Software

 View Only
Expand all | Collapse all

Milestones: Child Projects NOT Automatically Inheriting from Parent

  • 1.  Milestones: Child Projects NOT Automatically Inheriting from Parent

    Posted Nov 05, 2019 06:17 PM
    Edited by Daniel Burrow Nov 06, 2019 10:18 AM
    Greetings!

    In the "Project Hierarchy Overview" section, of the "Set Up Your Teams" documentation, the assertion is made that, "Child projects automatically inherit all milestones of the parent project." See:Getting Started: Setup Rally: Setup Your Teams

    This has not been my experience when creating a new Milestone. I first attempted to use the "TargetProject" (name) with my projectId (value) and received the following response:

    {
    "CreateResult": {
    "_rallyAPIMajor": "2",
    "_rallyAPIMinor": "0",
    "Errors": [
    "Not authorized to create: Milestone"
    ],
    "Warnings": [
    "Modification of the TargetProject property is deprecated. Use the Projects property to specify a list of projects instead."
    ]
    }
    }

    When using the Projects syntax I am successfully creating the Milestone for the parent project but the child projects are NOT inheriting the milestone.

    {
      "Name": "Daniel Burrow Test",
      "TargetDate": "2019-11-11",
      "Projects": {
      "_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/project/123456"
      },
      "Workspace": {
      "_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/123456"
      }
    }




    ------------------------------
    Dan Burrow
    DevOps Engineer
    Optum Global Solutions
    ------------------------------


  • 2.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Posted Nov 07, 2019 10:25 AM
    Edited by Daniel Burrow Nov 07, 2019 10:25 AM
    Bumping so this shows up in the discussion list.

    ------------------------------
    Dan Burrow
    DevOps Engineer
    Optum Global Solutions
    ------------------------------



  • 3.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Broadcom Employee
    Posted Nov 07, 2019 12:31 PM
    Hi Daniel.

    I feel this is quite confusing. I'll try to go over some of this, but advance apologies if this will still be confusing.

    Milestones aren't included in a project. In fact, it is the project that is included in a milestone. The notion of 'inheritance' is inaccurate here because the projects don't include milestones. I believe what this documentation statement is trying to say is that Child Projects will automatically be assigned/included in a milestone that includes a project ancestor. This is just terminology though, it probably isn't too confusing yet.

    You may want to check out this post, where I mentioned the difference between TargetProject and Projects. It used to be the case that setting a TargetProject will be allowed, and will unset the 'Projects' field. However, that seems to have changed.

    You can create/modify a milestone and set the 'TargetProject' field. You will get the deprecation warning, but yet, if you do that, you shall see that the 'Projects' field gets set with the project hierarchy underneath the project you targeted.

    The confusion is that despite the deprecation warning and that inability to actually set the TargetProject field itself, you can use that field to drive the 'inheritance' you need on the Projects field.


    I hope this helps. Let me know if that worked for you.

    Sagi









  • 4.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Posted Nov 07, 2019 01:55 PM
    Edited by Daniel Burrow Nov 07, 2019 01:59 PM
    Sagi,

    Your post was most helpful.

    I was able to update an existing milestone's TargetProject via the API and all of the TargetProject's descendant projects (children, grandchildren, etc) were assigned the milestone ref.

    What is odd is that I cannot CREATE a milestone that specifies a TargetProject in the the JSON body. The result is

    {
        "CreateResult": {
            "_rallyAPIMajor""2",
            "_rallyAPIMinor""0",
            "Errors": [
                "Not authorized to create: Milestone"
            ],
            "Warnings": [
                "Modification of the TargetProject property is deprecated. Use the Projects property to specify a list of projects instead."
            ]
        }
    }


    ------------------------------
    Dan Burrow
    DevOps Engineer
    Optum Global Solutions
    ------------------------------



  • 5.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Broadcom Employee
    Posted Nov 07, 2019 02:04 PM
    Hi Daniel,

    This is very strange. I can create a milestone with setting the TargetProject as you see below. I don't get the error. I do get the warning, but that warning will always come when you try to use the TargetProject field, still the outcome is working (including the 'inheritance').

    {
        "Milestone": {
            "Name": "Sagi_New_Milestone_1",
            "TargetProject":"/project/197887695948"
        }
    }

    Are you able to create a milestone from the browser?
    Perhaps your username doesn't have the permissions to create milestones?  (even though, if that were the case then I'd expect you won't be able to update a milestone either).

    Perhaps one/some of the projects you're trying to target to the milestone you're creating are not authorized for you?

    You may look at My Settings (under avatar) to find out all your permissions, perhaps you can identify there a problem with your permission with respect to any of the projects that are supposed to be impacted by this creation?


    Sagi


  • 6.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Posted Nov 07, 2019 02:18 PM
    I have Editor privileges.


    ------------------------------
    Dan Burrow
    DevOps Engineer
    Optum Global Solutions
    ------------------------------



  • 7.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Broadcom Employee
    Posted Nov 07, 2019 02:25 PM
    Thanks Daniel.

    That explains it then. Editors don't have permissions to create milestones. You can confirm that from the browser too where you won't find the 'New Milestone' option in the Timeboxes -> Milestone page. 

    Check out this help page that explains:
    "Administrators can create milestones at the Workspace Permissions Level."


    Sagi


  • 8.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Posted Nov 07, 2019 02:43 PM
    Oddities just keep piling up.

    I, as an Editor, have been creating Milestones via the API for about a week.

    {
    "Milestone": {
      "Name": "TCPBM 'projects' Daniel Burrow Test",
      "TargetDate": "2019-11-11",
      "Projects": {
            "_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/project/152254033656"
      },
    "Workspace": {
             "_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/14457696030"
    }
        }
    }

    ------------------------------
    Dan Burrow
    DevOps Engineer
    Optum Global Solutions
    ------------------------------



  • 9.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent
    Best Answer

    Broadcom Employee
    Posted Nov 07, 2019 02:48 PM
    Ok.

    Let's do this:
    I'd suggest don't worry about the API right now. The API should work for Create the same that it already works for you for Update. However, Create will work if you have permissions to create. If you do have permissions to create then you should be able to do that from the UI as well.

    In order to be sure if you can or can't create milestones:
    - Can you create them from the UI if you go into Rally -> Plan -> Time Boxes and select the Milestones in the drop-down. Do you see a New Milestone option?

    Also, when you to go the UI and click My Settings under the avatar, you should see your permissions. If you have a number of pages there, then please visit all of them. Do you see any mention of being either a Workspace Admin or a Project Admin in any of these pages?

    Thanks.
    Sagi




  • 10.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Posted Nov 10, 2019 04:28 PM
    Sagi is The Man of Wisdom and Skill We Treasure!

    My privileges were at an "Editor" role. Once the "Admin" role was added I was able to begin successfully creating Milestones with a TargetProject.

    In my Milestone class (this runs under a Jenkins instance and requires Groovy syntax)
    // using "old" TargetProject syntax. This ensures Project -> Child Project cascading
    private String buildJsonBodyForCreatingMilestone() {
    JsonBuilder builder = new JsonBuilder()
    // note the syntax of DoubleQuote${variable}DoubleQuote
    builder.Milestone {
    c_ProductionDeploymentID "${productionDeploymentId}"
    Name "${name}"
    TargetDate "${targetDate}"
    TargetProject "${rallyProjectId}"
    Description "${description}"
    Notes "${notes}"
    c_Type "${rallyMilestoneCType}"
    DisplayColor "${rallyCreatedMilestoneDisplayColor}"
    Workspace {
    _ref "${workspaceRef}"
    }
    }
    String jsonBodyForCreatingMilestone = builder.toString()
    return jsonBodyForCreatingMilestone
    }

    In my RallyApiService class
    public String postMilestoneToRally(String jsonBody) throws IOException {

    println "\n${this.getClass().name}: postMilestoneToRally: POST: JSON body:"
    println "\tjsonBody: prettyPrint: " + JsonOutput.prettyPrint(jsonBody) + "\n"

    OkHttpClient client = new OkHttpClient()
    MediaType JSON = MediaType.parse("application/json; charset=utf-8")

    RequestBody body = RequestBody.create(JSON, jsonBody)
    Request request = new Request.Builder()
    .url(rallyServerApiEndpoint + "/milestone/create")
    .addHeader("Authorization", "Bearer " + rallyApiToken)
    .post(body)
    .build()

    try {
    Response response = client.newCall(request).execute()
    return response.body().string()

    } catch (Exception e) {
    println("error ${e}")
    }

    }


    ------------------------------
    Dan Burrow
    DevOps Engineer
    Optum Global Solutions
    ------------------------------



  • 11.  RE: Milestones: Child Projects NOT Automatically Inheriting from Parent

    Broadcom Employee
    Posted Nov 12, 2019 11:47 AM
    :)

    Thanks so much Daniel. I'm truly glad it helped you.

    Sagi