0

I would like to be able to create project issue automatically. The aim is to create new issue based on received email.

I looked at ProjectWSSInfoDataSet, which is supposed to have reference to issue list (according to "PSI Methods and DataSets for Project Workspaces" at http://msdn.microsoft.com/en-us/library/aa495198(office.12).aspx). Indeed, ProjectWSSInfoDataSet XML schema contains PROJECT_ISSUES_URL field, but if it is just the url then it is not much usefull for me.

Has anyone did something similar? (Or possibly with project risks or deliverables.)

Lukáš Rampa
  • 877
  • 1
  • 8
  • 14

1 Answers1

0

I think have to do it with the SharePoint Webservices. Find the list in the specified web and update it.

I recommend the SharePoint 2010 Client Object Model to do this:

//Use SP2010 Client Object Model to update the list
ClientContext SPContext = new ClientContext(wssUrl);

//Get list by name
string listname = "issues";

var query = SPContext.LoadQuery(SPContext.Web.Lists.Where(l => l.Title == listname));
SPContext.ExecuteQuery();

List myIssueList = query.FirstOrDefault();

//Add an item
ListItemCreationInformation nItem = new ListItemCreationInformation();
nItem.LeafName = "Blubb..";
myIssueList.AddItem(nItem);
SPContext.ExecuteQuery();

If you wan't to get the Workspace Url via the Project Id, you can do this by WSSInterop Webservice of the Project Server:

//Use WssInterop Webservice to get the Workspace URL
WssInteropSoapClient wssinteropSvc = new WssInteropSoapClient();

Guid prjGuid = new Guid("30937680-39FA-4685-A087-90C73376B2BE");

ProjectWSSInfoDataSet wssData = wssinteropSvc.ReadWssData(prjGuid);
string wssUrl = wssData.ProjWssInfo[0].PROJECT_WORKSPACE_URL;

I don't know if the code will compile, but it should work like this.

Regards Florian

cansik
  • 1,924
  • 4
  • 19
  • 39