How do I start?

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

dbaltz
Posts: 17
Joined: Thu Dec 14, 2017 12:07 pm

Re: How do I start?

Post by dbaltz » Mon Dec 18, 2017 3:06 pm

Yes. I'm logged into the server and also Dragnet.

I tried just reading the open items and it throws the same exception.

Code: Select all

                try
                {
                    MantisItemExpanded[] openItems = ItemTrackingOperations.ProcessCommandListOpenFortressItems(projects[0].Name);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

dbaltz
Posts: 17
Joined: Thu Dec 14, 2017 12:07 pm

Re: How do I start?

Post by dbaltz » Mon Dec 18, 2017 3:28 pm

It looks like ServerOperations.client.ClientInstance is null.

Here is how I connect to the server:

Code: Select all

        VaultConnection con = new VaultConnection();
        Excel.Application objexcel;

        public Form1()
        {
            InitializeComponent();

            con.InitService(VaultConnection.AccessLevelType.Client);
            con.InitDragnetService();
            con.Login("http://tis-sa-ack1/VaultService", "[username]", "[pwd]");

            if (con.LoggedIntoDragnet == false)
                con.InitDragnetService();

Afterwards, the con._bConnected and con._bLoggedIntoDragnet both show true.

jclausius
Posts: 3655
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: How do I start?

Post by jclausius » Mon Dec 18, 2017 3:48 pm

Ahh. OK. It might be something in your login code, as the connection object is not meant to be used externally.

Since you have the API downloaded, can you load / and debug the command line project? On the arguments, have it login and run the LISTPROJECTS command. If you step through the command line, it will have the steps you'll want to use to login... Specifically calling ServerOperations.Login().

Or, if you want, you can trace through from bool VaultCmdLineClient.ProcessCommand(Args curArg) up to and including the call to ItemTrackingOperations.ProcessCommandListFortressProjects();
Jeff Clausius
SourceGear

dbaltz
Posts: 17
Joined: Thu Dec 14, 2017 12:07 pm

Re: How do I start?

Post by dbaltz » Mon Dec 18, 2017 4:43 pm

Yes, It appears that the global scope of the connection is the problem.

I have successfully validated an item!

jclausius
Posts: 3655
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: How do I start?

Post by jclausius » Mon Dec 18, 2017 5:05 pm

Congrats!!
Jeff Clausius
SourceGear

dbaltz
Posts: 17
Joined: Thu Dec 14, 2017 12:07 pm

Re: How do I start?

Post by dbaltz » Mon Dec 18, 2017 5:13 pm

Everything is working now. Thanks for the help.

dbaltz
Posts: 17
Joined: Thu Dec 14, 2017 12:07 pm

Re: How do I start?

Post by dbaltz » Mon Dec 18, 2017 5:39 pm

One last question:
How do I delete my test items from the work item project? Is there a way to delete the entire Project and entries?

jclausius
Posts: 3655
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: How do I start?

Post by jclausius » Tue Dec 19, 2017 9:10 am

Deleting a project is an administrative type function.

You will need to log into the Vault Admin web site using a login with administrative permissions. Next, click the 'Admin' link across the top. Click the "Item Tracking Projects" on the left hand side. You should see a list of projects which you can delete by clicking the red 'X' to the right.
Jeff Clausius
SourceGear

dbaltz
Posts: 17
Joined: Thu Dec 14, 2017 12:07 pm

Re: How do I start?

Post by dbaltz » Tue Dec 19, 2017 9:34 am

Thanks.

jclausius
Posts: 3655
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: How do I start?

Post by jclausius » Tue Dec 19, 2017 11:52 am

NP!
Jeff Clausius
SourceGear

Post Reply