Workflow does not execute through code but does execute otherwise + sharepoint 2007 - sharepoint-2007

I created a workflow through Sharepoint Designer 2007 that simply updates a list item when a change is made to a particular list item.
But the workflow executes when I make changes to the list item through Browser. But when same changes are made through code, it does not execute.

I was accessing the link with Elevated Privileges, i.e. through System Account. Due to Security reasons, Workflows dont run under System Account.
I had to impersonate as a user to access and modify the list. And workflow executed.

Related

TFS Administration Console Adding and Removing Users

I am working with team foundation server and I added a user in the server from Administration Console and the user has access to the server. But the problem is even when I remove that user from Administration Console user still able to login to the server. Can anyone help me here? Thank you in advance.
To remove users completely from TFS server. You should remove the user from all the security groups.
UsE the command below to get this account has been added to which groups. Then check all those groups and try to remove that account from those groups.
TFS security imx:
tfssecurity /imx [domain\account] /server:[server url]
Besides, changes you make to local or Active Directory groups do not get reflected in TFS immediately. Instead, TFS will synchronize those groups regularly.
A periodic clean-up job that is executed removes people from the global groups. If you just wait, they will disappear in a couple of days. They will not have access to any of the TFS assets however.
You could look in http://tfs.mydomain.com:8080/tfs/_oi to see the sync job.
If you cannot wait for the scheduled job, you can try to do the force sync: http://msmvps.com/blogs/vstsblog/archive/2011/02/17/force-tfs-to-sync-with-active-directory.aspx

In TFS Online, How do I share a code branch with our customer

We have an enterprise customer that we have delivered a system for. It is part of the agreement for us to supply them with the source code of the latest release. We are using TFVC on TFS online, and we thought it would be easiest to give them access to our Main branch. But I have difficulties with only allowing them to access the code and nothing else. The user I am testing with, can see too much: I.e. things like dashboard, current team members etc.
Is it possible for me to only expose code from the Main branch and nothing else to an external user?
Giving access to TFS Main Branch out of Organization (AD) is not advisable considering security.. Instead consider giving source code into zip format there are lot of large file sending (FTP sites) are available..
Still for your request of restricting access to user have a look over this
https://www.visualstudio.com/en-us/docs/setup-admin/restrict-access-tfs
you can consider replicating your part of source code into separate stream and give reader read only access to that stream.
Hope this helps... :)
Refer to these steps to set the permission:
Add user to your VSTS (Basic)
Remove this user from all group if you added
Go to admin page of a team project Version Control (Setting > Version Control)
Select a folder/branch
Click Add > Add User to add that user
Select the user that you added
Set Read permission to Allow
Go to Security page (click Security)
Click Create group to create a new group
Set View project-level information to Allow and deny other permissions for this group
Click Members of that new group
Click Add to add that user to this group
After that, this user can access the code (Just the folder/branch the user has the read permission) on web access (Code > Files).

Creating a template for work items in TFS

Does TFS 2013 have the ability to automatically add Templated tasks to a work item?
So I create a work item, it automatically adds some tasks for it such as Code, Test, CodeReview, HelpGuide
Can you guide me to the right place to read about it if it has this ability.
Built-in? Then no.
There is an open source TFS Serverside plugin, called TFS Aggregator which will allow you to run a piece of code every time a workitem changes. Creating subtasks when a parent task changes state or is created is a piece of cake.
See:
https://github.com/tfsaggregator/tfsaggregator/releases
https://github.com/tfsaggregator/tfsaggregator/wiki/Auto-Create-Children
If you don't want to run a server side handler, then you may be able to use a script (powershell can do pretty powerful things when using the Client Object Model).
Or you can use the copy-paste magic of the Excel plugin for TFS. Simply put the tasks you want to create on the clipboard (without an ID) then use the "Insert Rows" paste option to paste them directly under their prospective parent (in a tree based query). Upon publishing the tasks will be associated to the parent. Play with the Title 1, Title 2, Title 3 etc fields to control the nesting.

Registering custom checkin policy for Certain users in TFS

I have created custom checkin policy for TFS. It is deployed to the client system. I have added the custom checkin policy for project collection in TFS. But I have a number of clients that have not installed the custom checkin policy, when these developers want to check in, Visual Studio shows an error
Internal error in Check for PMS Details. Error loading the Check for PMS Details ...
So I want to apply the custom checkin policy for certain users. For example the user is admin then no need to run the custom checkin policy.
As others mention, the policy needs to be installed on the Client machine to work. There is no getting around that. You can, however, in the policy itself check the Identity and group membership of the user doing the check-in and skip the policy validation (always return an empty array of PolicyFailures) in that case.
I have been working on such a policy, but never found time to finish it. The policy I have been building works in the same way as the ConditionalPath policy that ships in the TFS Power tools. Basically it wraps another (set of) rules and places a condition on their execution.
Custom policies need to be installed onto the client system, they are not centrally processed.
A check in policy can be scoped only to the project level within TFS, as far as I am aware you are unable to limit a policy in any other way unless you handle this within the policy itself.
You must install your check-in policies on all TFS Windows clients, otherwise you get the nasty error.
A conditional policy can be implemented in two ways.
set the condition inside the custom policy code
use a Gated check-in build and customize the Build template
There is a third option, a Server side event handler, but I generally discourage it.

TFS API: How to check if a work item has been deleted or is non existent on the TFS Server? (not if it is accessible)

I am using TFS API and I need to check if a workitem has been deleted or if it does not exist.
If i use WorkItemStore.GetWorkItem(Int32) and pass the Id of a deleted Work Item here, then the message says that "The work item does not exist, or you do not have permission to access it."
I need to check only for the deleted condition and not the inaccessible condition.
I've searched in the API but could not find any way to check for it.
I need this because I need the list of workitems that have been deleted.
In my program I have a list of some existing workitems. I then need to check if any of these workitems are deleted but I don't have to care whether the logged in user has permissions to see it or not.
And in my program I need to be absolutely sure that the workitem has been deleted because I have to make some irrevertable changes for every deleted workitem from my list.
You can't. If you don't have permission to open the work item, then you can't query information about it. It's a bit of chicken/egg. Even when you do have permission, you cannot be sure a workitem was deleted, or has not yet been created.
I'd run your tool as a service somewhere under a user that has project collection level permission or server level permissions to read the work items. You could also implement your own webservice which does that and then use the outcome in your tool.

Resources