James Mann's Blog

The blog of James Mann

Part 1/2: Integrating a SharePoint workflow with TFS / eScrum - Creating the product

As part of a project tracking workflow we have various points in the lifecycle of a project where we want to poke data into TFS, and have that data exposed through eScrum.

In particular, we need to:

  1. Create a new eScrum Product (at the inception of the project)
  2. Create eScrum Product Backlog items (on a weekly cycle)

After a bit of digging and dissassembling it turns out that it is not that hard to do. The first of the two above tasks implementation is as follows:(note that the eScrumRootAreaPathURI is the URI of the eScrum Team Project - you can find this URI in the team explorer in VS - it will look something like vstfs:///Classification/TeamProject/a1bac9db-c321-4fe6-8a12-fa19b4c2abab):

 

public static void CreateEScrumProduct(string name, string eScrumRootAreaPathURI, string tfsurl, string username, string password, string host)
{

    NetworkCredential account = new NetworkCredential(username, password, host);
    TeamFoundationServer server = new TeamFoundationServer(tfsurl, account);
    server.Authenticate();     /**
     * first the area path for the product must be created in the eScrum team project.
     */
    ICommonStructureService ics = (ICommonStructureService)server.GetService(typeof(ICommonStructureService));
    NodeInfo[] ni = ics.ListStructures(eScrumRootAreaPathURI);

    foreach (NodeInfo n in ni)
    {
        if (n.StructureType == "ProjectModelHierarchy")
        {
            ics.CreateNode(name, n.Uri);
            break;
        }
    }

    /**
     * now a new eScrum product details work item must be created referencing the above
     * area path. note that this can fail due to the tfs warehouse not refreshing
     * so it is brute forced until a better way is apparent.
     */
    Thread t = new Thread(delegate()
    {
        bool cont = true;
        while (cont)
        {
            try
            {
                WorkItemStore store = new WorkItemStore(server);
                WorkItem item = new WorkItem(store.Projects["Escrum"].WorkItemTypes["eScrum Product Details"]);
                item.Title = name;
                item.Fields["Area Path"].Value = @"Escrum\" + name;
                item.Fields["Assigned To"].Value = "Escrum Team";
                item.Save();

                cont = false;

            }
            catch (Exception ex)
            {
                Trace.WriteLine("failed saving... attempting again in 1000ms");
                Thread.Sleep(1000);
                cont = true;
            }
        }
    });
    t.Start();
} 
Technorati Tags: ,,,

Comments (14) -

  • zxevil163

    3/16/2008 10:36:44 AM |

    A8fTKn Hi from Russia!

  • zxevil163

    3/16/2008 10:37:59 AM |

    hOuLYm Hi from Russia!

  • zxevil163

    3/16/2008 10:38:17 AM |

    eKkIEM Hi from Russia!

  • zxevil163

    3/16/2008 10:38:29 AM |

    oDvslf Hi from Russia!

  • zxevil163

    3/16/2008 10:38:47 AM |

    XQ9Zf4 Hi from Russia!

  • zxevil163

    3/16/2008 10:41:33 AM |

    lsoVTk Hi from Russia!

  • zxevil163

    3/16/2008 10:43:22 AM |

    ENZTOE Hi from Russia!

  • acne no more review

    9/18/2013 2:05:33 PM |

    I used to be very happy to find this internet-site.I wanted to thanks to your time for this excellent read!! I definitely having fun with each little little bit of it and I have you bookmarked to check out new stuff you weblog post.

  • att uverse

    12/12/2013 7:41:03 PM |

    I believe that is one of the so much vital information for me. And i'm satisfied reading your article. However wanna remark on few common things, The site taste is wonderful, the articles is in reality nice : D. Excellent activity, cheers

  • Elsie Heuberger

    1/18/2014 4:44:17 PM |

    People suffering with zits will oftentimes want to pop their infected pores. If you do decide to pop them, make sure that your hands and nails are clean and sanitized to avoid causing your skin further damage by adding more bacteria to the open pore.

  • Get Rid Of Acne

    4/6/2014 12:08:07 PM |

    Some of your images are broken

  • Get Rid Of Acne

    4/6/2014 12:27:48 PM |

    Some of your images are broken

  • Roderick Jannusch

    4/12/2014 11:13:16 AM |

    I'll gear this review to 2 types of people: current Zune owners who are considering an upgrade, and people trying to decide between a Zune and an iPod. (There are other players worth considering out there, like the Sony Walkman X, but I hope this gives you enough info to make an informed decision of the Zune vs players other than the iPod line as well.)

  • Mariana Osberg

    4/12/2014 11:22:06 AM |

    If you're still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you'll know which is right for you.

  • Kami Jolivette

    4/12/2014 11:24:53 AM |

    Zune and iPod: Most people compare the Zune to the Touch, but after seeing how slim and surprisingly small and light it is, I consider it to be a rather unique hybrid that combines qualities of both the Touch and the Nano. It's very colorful and lovely OLED screen is slightly smaller than the touch screen, but the player itself feels quite a bit smaller and lighter. It weighs about 2/3 as much, and is noticeably smaller in width and height, while being just a hair thicker.

  • Oren Emison

    4/12/2014 11:27:35 AM |

    Hands down, Apple's app store wins by a mile. It's a huge selection of all sorts of apps vs a rather sad selection of a handful for Zune. Microsoft has plans, especially in the realm of games, but I'm not sure I'd want to bet on the future if this aspect is important to you. The iPod is a much better choice in that case.

  • Ashlyn Kratowicz

    4/12/2014 11:31:24 AM |

    The Zune concentrates on being a Portable Media Player. Not a web browser. Not a game machine. Maybe in the future it'll do even better in those areas, but for now it's a fantastic way to organize and listen to your music and videos, and is without peer in that regard. The iPod's strengths are its web browsing and apps. If those sound more compelling, perhaps it is your best choice.

  • Alphonso Labeau

    4/12/2014 11:37:18 AM |

    Hands down, Apple's app store wins by a mile. It's a huge selection of all sorts of apps vs a rather sad selection of a handful for Zune. Microsoft has plans, especially in the realm of games, but I'm not sure I'd want to bet on the future if this aspect is important to you. The iPod is a much better choice in that case.

  • Tonie Salak

    5/13/2014 2:11:55 PM |

    Hi there! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no back up. Do you have any methods to prevent hackers?

  • Gus Primo

    9/17/2014 9:27:40 PM |

    Great task I like your design! Would genuinely like to right here your feedback on my website! I am also searching for someone to assist me make websites!

  • Ardith Mussenden

    11/2/2014 3:36:55 PM |

    Hey very cool odiassd site!! Man .. Excellent .. Amazing .. I will bookmark your blog and take the feeds also…I’m happy to find numerous useful info here in the post, we need work out more strategies in this regard, thanks for sharing. . . . . ….

Loading