Automatically send TFS WorkItems to MS Project Server (Work Item Workflow) - tfs-workitem

I have Microsoft Project Server 2013 integrated with a TFS 2012 instance. I have the ability to create work items from project and tfs and it will sync back and forth.
What I'm trying to do is have certain work item types automatically submit to project server. Below is what I have found elsewhere, and it almost works (Submit is yes) but the ProjectName field is showing up blank.
I get the errors: "Field 'Project Server Enterprise Project' cannot be empty and Field 'Project Server Sync Requested Project GUID' cannot be empty.
Does anyone know how I can find what TFS expects for these values?
<TRANSITION from="" to="To Do">
<REASONS>
<DEFAULTREASON value="New task" />
</REASONS>
<FIELDS>
<FIELD refname="Microsoft.Sync.ProjSrv.Submit">
<COPY from="value" value="Yes" />
</FIELD>
<FIELD refname="Microsoft.Sync.ProjSrv.ProjectName">
<COPY from="value" value="PROJECT_SERVER_PROJECT_NAME" />
</FIELD>
</FIELDS>
</TRANSITION>

I believe the values you're after are;
'Project Server Sync Requested Project GUID' = Microsoft.Sync.ProjSrv.RequestedProjGuid
'Project Server Enterprise Project' = Microsoft.Sync.ProjSrv.ProjectName
Is your team project mapped to a single project plan? If so Microsoft.Sync.ProjSrv.ProjectName will be readonly, you only need to specify it if it is mapped to multiple project plans.

Related

TFS 2013 Bug Work Item Template: Hide and Un-Hide Fields Based on Another Field's Value for Additional Input Parameters

I am in the process of updating my Bug template in TFS 2013 via the Process Editor tool in Visual Studio.
I'm attempting to only display an additional field when a specific choice is selected from one of the drop-down menus. We require individuals filing bugs to select the environment in which the bug was found, i.e., Development, Test, Staging, Production. I want an additional string field to display when "Production" is selected from the Environment drop-down menu. I also want this field to be required when "Production" is selected before the item can be saved.
I'm sure this is easy to do, but, I just can't figure it out.
Any help would be fantastic, thank you!
You can have the XML of Environment field looks like:
<FieldDefinition name="EnvironmentCustom" refname="env.field" type="String">
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="Development" />
<LISTITEM value="Test" />
<LISTITEM value="Staging" />
<LISTITEM value="Production" />
</ALLOWEDVALUES>
</FieldDefinition>
And make the XML of additional field looks like:
<FieldDefinition name="VarCustom" refname="var.field" type="String">
<WHEN field="env.field" value="Production">
<REQUIRED />
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="good" />
<LISTITEM value="bad" />
</ALLOWEDVALUES>
</WHEN>
</FieldDefinition>
In this way, you'll see Environment field has a drop down with values "Development", "Test", "Staging", "Production", and additional field has a drop down with values "good", "bad". Once you select "Production" in Environment field, the additional field will become Required, you'll have to select a vlue for additional field before saving this work item type.
Adding:
If you don't want to a drop down under the additional field, you can remove the ALLOWEDVALUES rule, then you can type any string in it. The XML looks like:
<FieldDefinition name="VarCustom" refname="var.field" type="String">
<WHEN field="env.field" value="Production">
<REQUIRED />
</WHEN>
</FieldDefinition>
It's not able to hide/un-hide VarCustom field by using Rules, you need to customize your own work item control to achieve your requirement. You can check the links and examples about custom work item control at website below:
https://witcustomcontrols.codeplex.com/

Sitecore.Context.User.IsAuthenticated returns true for extranet\Anonymous user

I have Sitecore 6.6 installed. I wanted to add a new domain to Sitecore; Since my Sitecore instance is deployed in two servers with two Sitecore sites in each pointing to different web databases but same core, master and analytics databases, I couldn't do it using Sitecore Domain manager.So I thought of doing it manually by editting the App_Config\Security\domains.config in the server. The following was the domains.config that I had.
<?xml version="1.0" encoding="utf-8"?>
<domains xmlns:sc="Sitecore">
<domain name="sitecore" ensureAnonymousUser="false" />
<domain name="extranet" defaultProfileItemId="{AE4C4969-5B7E-4B4E-9042-B2D8701CE214}" />
<domain name="default" isDefault="true" />
<sc:templates>
<domain type="Sitecore.Security.Domains.Domain, Sitecore.Kernel">
<ensureAnonymousUser>true</ensureAnonymousUser>
<locallyManaged>false</locallyManaged>
</domain>
</sc:templates>
<domain name="Station" defaultProfileItemId="{F181ED3D-F342-46E6-B6F6-2A6A6173B513}" />
<domain name="Emailcampaign" />
</domains>
I added one more domain(MyDomain) at the end like below.
<?xml version="1.0" encoding="utf-8"?>
<domains xmlns:sc="Sitecore">
<domain name="sitecore" ensureAnonymousUser="false" />
<domain name="extranet" defaultProfileItemId="{AE4C4969-5B7E-4B4E-9042-B2D8701CE214}" />
<domain name="default" isDefault="true" />
<sc:templates>
<domain type="Sitecore.Security.Domains.Domain, Sitecore.Kernel">
<ensureAnonymousUser>true</ensureAnonymousUser>
<locallyManaged>false</locallyManaged>
</domain>
</sc:templates>
<domain name="Station" defaultProfileItemId="{F181ED3D-F342-46E6-B6F6-2A6A6173B513}" />
<domain name="Emailcampaign" />
<domain name="MyDomain" />
</domains>
As soon as I did that, Sitecore.Context.User.IsAuthenticated started returning true for extranet\Anonymous user(Non-logged in user) in the code.
Has anyone faced this issue before?
Please let me know where am I going wrong.
I also encounted this issue back when I was working with Sitecore 6.6, I'm not certain if its an issue in later versions. Essentially when you modified your domains.config with the param ensureAnonymousUser set to true the Anonymous User for that domain, in this case Extranet, was created in the database - it may not have been until you changed that setting.
In Sitecore all non-logged in users view the site as the user *domain*/anonymous. As Sitecore's membership is based on .NET Membership it determines that the User is logged in as its using that account.
Therefore I recommend completing an additional check with your Sitecore.Context.User.IsAuthenticated to check if the username of User's account is *domain of site*/anonymous, Sitecore.Context.User.Name, if it is return false.
EDIT
I have confirmed Sitecore.Context.User.IsAuthenticated returning true for *domain*\Anonymous user has been fixed in Sitecore 8. Therefore you can use it to determine if the User is logged in and not using the *domain*\anonymous account.
We finally resolved this issue! This was caused by a fix we added to solve an issue we had with Sitecore ECM. The issue was that Sitecore used to log out as soon as we clicked on the message preview. So we followed the steps given in the below thread to fix the issue.
https://stackoverflow.com/a/30836600/4165670
But we were not testing for Anonymous user like it is done in the thread. We never pushed this code into Content Delivery site and when
we created the new domain, This code got pushed into the Content Delivery site with some other code.
Since we are setting the current user as the Active user in the code, it started showing that extranet\Anonymous user as the current user.

Sharepoint Deploy new Column to list

I'm fairly new to SharePoint 2010, I've had some experience with 2007 but only debugging and fixing some small bug.
Assuming that i create a new solution for SP 2010 in VS2010 and i add a feature to create some list definitions and also some list instances of those list definition templates. These are all declared through Schema.xml =>
I deploy successfully and add a few items to my new lists.
Now i want to add a few extra columns (fields) to my lists, how will i deploy them?
I don't want to create them in code, i would like to have a up to date solution that with every new developer a simple deployment would create an up and running Dev environment.
What is the correct way to do the deployment in this case?
If you have the schema.xml file defined for the list, then you really want to add your new columns using the collection within the list definition. You also want to be sure your list is defined by a content type, allowing for reuse. So within your schema.xml file, it would look something like this:
<List xmlns:ows="Microsoft SharePoint" Title="Test List" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Test-List" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentType ID="0x010068a2e063a1a74913a37ecdb61ab2c721" Name="Test" Group="Custom Content Types" Description="Test Description" Inherits="TRUE" Version="0">
<FieldRefs>
<FieldRef ID="{c2f80e7d-666e-4273-8b58-d5c8a13a9d6a}" Name="Col1" ShowInNewForm="TRUE" Required="TRUE" ShowInEditForm="TRUE"/>
<FieldRef ID="{a84d620a-d42d-455c-8ef8-7e9f1d443250}" Name="Col2" Required="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE"/>
<!-- Your new field refs here here -->
</FieldRefs>
</ContentType>
</ContentTypes>
<Fields>
<Field ID="{c2f80e7d-666e-4273-8b58-d5c8a13a9d6a}" Type="Text" AllowDeletion="FALSE" Description="Key" AllowDuplicateValues="FALSE" EnforceUniqueValues="TRUE" Indexed="TRUE" Name="Col1" DisplayName="Col1" Group="Custom Columns" />
<Field ID="{a84d620a-d42d-455c-8ef8-7e9f1d443250}" Type="Text" AllowDeletion="FALSE" Name="Col2" DisplayName="Col2" Group="Custom Columns" />
<!-- Your new fields here -->
</Fields>
...
</MetaData>
</List>
Don't forget to change your View as well!

SharePoint 2010 List Schema.XML not working as imagined

I am created an External List in VS and in the schema.XML file I have a few fields that I would like to change their display name, and format some dates.
We created an External List in SP, exported the wsp, and grabbed the list components of the site and added it to our project.
Here is an example of what I thought would work, but it does not.
<Field DisplayName="Date Closed" Format="DateOnly" Hidden="FALSE" Name="DateClosed" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="DateClosed" Type="DateTime" />
<Field DisplayName="Closed By" Hidden="FALSE" Name="ClosedBy" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="ClosedBy" Type="Text" />
We have a filter setup in the section which is working, so I know that the file is being used. Any insight as to why the changes I made to the field are not taking effect?

How do I rename a file using the SharePoint web services?

I have a custom definition for a document library and I am trying to rename documents within the library using only the out of the box web services. Having defined a view with the "Name" field supplied and trying the "LinkFilename", my calls to rename a file are respectively returning a failure or ignoring the new value.
How do I rename a file using the SharePoint web services?
Use the Lists.UpdateListItems web method. The XML request should look like:
<Batch OnError="Continue" PreCalc="TRUE" ListVersion="0">
<Method ID="1" Cmd="Update">
<!-- List item ID of document -->
<Field Name="ID">2</Field>
<!-- Full URL to document -->
<Field Name="FileRef">http://Server/FullUrl/File.doc</Field>
<!-- New filename -->
<Field Name="BaseName">NewName</Field>
</Method>
</Batch>
You should be able to use UpdateListItems. Here's an example.
Per comment: So the actual question is "how do I call a web service?" Take a look a this example. Some more good walkthroughs here.