i have a string in which i am using String.format in this i want to remove the 2nd parameter if string iteration will come as ="" or NULL and also want to remove the
. AND [Source].[System.IterationPath] IN ('{1}') from the String that will be formed.
public void GetProjectInfo(string projectname,string Iteration)
{
string querystring = string.Format("select [System.Id], [System.Title],[Story.Author],[Story.Owner],[System.AssignedTo]," +
" [System.WorkItemType],[Microsoft.VSTS.Scheduling.StoryPoints],[Microsoft.VSTS.Common.Priority]," +
"[Microsoft.VSTS.Scheduling.Effort], [Actual.Effort.Completed]" +
",[System.State]," +
"[System.IterationPath]" +
" FROM WorkItemLinks" +
" WHERE" +
" ([Source].[System.TeamProject]='{0}'" +
" and [Source].[System.WorkitemType] IN ('Feature', 'Bug', 'Product Backlog Item', 'Task')" +
" AND [Source].[System.IterationPath] IN ('{1}'))"//this line of code will be removed along with iteration parameter
+
" and ([System.Links.LinkType]='System.LinkTypes.Hierarchy-Forward')" +
" ORDER BY [System.Id] " +
" mode (Recursive)", projectname, Iteration);
}