Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 608843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:30:09+00:00 2026-05-13T17:30:09+00:00

I am trying to get from State A to State X. There are transitions

  • 0

I am trying to get from State “A” to State “X”.

There are transitions in place that prevent me from just going to X.

I can export the WorkItemType as XML and work on that, but before I do that, I thought I would ask if there is a way to get at the Transitions via the API.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:30:10+00:00Added an answer on May 13, 2026 at 5:30 pm

    Soooo…..

    Not many people need the transitions for WorkItemTypes.

    Well, I needed it so I wrote a method to do it. Here it is in case someone else ever needs this:

    // Hold a list of all the transistions we have done.  This will help us not have run them again If we already have.
    private static Dictionary<WorkItemType, List<Transition>> _allTransistions = new Dictionary<WorkItemType, List<Transition>>();
    
    /// <summary>
    /// Get the transitions for this <see cref="WorkItemType"/>
    /// </summary>
    /// <param name="workItemType"></param>
    /// <returns></returns>
    private static List<Transition> GetTransistions(this WorkItemType workItemType)
    {
        List<Transition> currentTransistions;
    
        // See if this WorkItemType has already had it's transistions figured out.
        _allTransistions.TryGetValue(workItemType, out currentTransistions);
        if (currentTransistions != null)
            return currentTransistions;
    
        // Get this worktype type as xml
        XmlDocument workItemTypeXml = workItemType.Export(false);
    
        // Create a dictionary to allow us to look up the "to" state using a "from" state.
        var newTransistions = new List<Transition>();
    
        // get the transistions node.
        XmlNodeList transitionsList = workItemTypeXml.GetElementsByTagName("TRANSITIONS");
    
        // As there is only one transistions item we can just get the first
        XmlNode transitions = transitionsList[0];
    
        // Iterate all the transitions
        foreach (XmlNode transition in transitions)
        {
            // save off the transistion 
            newTransistions.Add(new Transition
                                    {
                                        From = transition.Attributes["from"].Value,
                                        To = transition.Attributes["to"].Value
                                    });
    
        }
    
        // Save off this transition so we don't do it again if it is needed.
        _allTransistions.Add(workItemType, newTransistions);
    
        return newTransistions;
    }
    
    public class Transition
    {
        public string To { get; set; }
        public string From { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get from an Android Uri to a byte array. I have
I'm trying to get from Line #1 to Line #2 in the below code:
I am trying to get an Audio file through http get from a secure
Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,
I am trying to get coordinates from GPS (this actually gives the values for
I'm trying to get values from nsdata class and doesn't work. here is my
I am trying to get value from passwordbox for developing a simple login functionality,
I'm trying to get information from this site: http://www.gocrimson.com/sports/mbkb/2011-12/roster If you look at that
I'm trying to get content from an RSS2 feed from one of my sites
i am trying to get date from my implementation of jquery date picker, add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.