Co-recurisive workflows not starting on second cycle - sharepoint-2007

My scenario is:*
Workflow A - configured to start when a new item is created in List A:
Creates a new list item in List B.
Workflow B - configured to start when a new item is created in List B:
Creates a new list item in List A.
When I test this i get the following:
I manually create a list item in List A.
Workflow A fires and creates a new list item in List B.
Workflow B fires and creates a new list item in List A.
But a new instance of Workflow A does not instantiate on the created in List by Workflow B.
---edit-----
Is this happening because the item created in List A by Workflow B is created by System Account thus not firing Workflow A?
---------edit---------------------------------------
I am aware this is causes an infinite loop there is a pause for duration action set to 1 year in workflow A. So it fires in yearly cycles.
I know sp2 prevents infinite loops being created on the same list but from what i read of the article below suggests this is possible to do cross lists as in my scenario.
Link

The answer was co-recursive workflows do not work cross lists as I assummed. The msdn blog link above scenario uses two workflows on the same list. I adjusted my workflows to use the same list.
The error was output to my log files but since logging was not set to verbose i didn't see it.

Related

Best approach to get count of workitems state transitions?

I need to create a dashboard widget for Azure DevOps that shows number of work items of a specified type, that transitioned from one state to another.
It looks like the Updates endpoint is my best bet, but that means that I would have to iterate over all of the updates of workitems for the specified type and then determine if it contains the state transition I'm looking for, e.g. Closed to Open.
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/updates/list?view=azure-devops-server-rest-5.0
The Analytics extension looked promising, but it looks like I would need to query the Revisions dataset, and that doesn't contain the old and new values.
https://learn.microsoft.com/en-us/azure/devops/report/extend-analytics/wit-analytics?view=azure-devops
The use case is to show the number of bugs that were closed then reopened in the last 90 days. I thought that I would make the work item type and from and to states configurable.
Any ideas or suggestions much appreciated!
Best approach to get count of workitems state transitions?
At this moment, we could not query the History with State changed from one state to another state on Web UI directly.
As workaround, we could add a custom field in our custom process that gets set the value to true when workitems state change from Closed to New:
Then add a Rules to set the value of the custom field to True if the workitems state change from Closed to New:
Finally, we could query the workitems with following conditions:
BTW, if you want to get those workitems which state already changed from Closed to New before use above custom filed and rules, I am afraid you have to use Rest API to query the work items that in specified type:
https://learn.microsoft.com/en-us/rest/api/vsts/wit/wiql/query%20by%20wiql
Then loop the work items list to get all revisions for every work item with Revision - List API:
https://learn.microsoft.com/en-us/rest/api/vsts/wit/revisions/list
There is a article for TFS TFS SDK: Work Item History Visualizer using TFS API, you can check it for some more details.
Hope this helps.
You may do it through PowerBI. Calculate time-in-state for an existing Analytics view
Or as you said iterate over all of the updates of workitems.

Is there a quick way to add work items with child links?

Each time we create a patch iteration, we have a number of specific activities we need to perform before we can release. These are typically under a story 'Release activities' and are child items such as 'Update Help Guide', 'Targeted Regression', 'Produce Changelog' etc...
What I'd like to do is have a template I can use where I can quickly create the parent story in the target iteration, and have the child items automatically created. Is this possible without using the API? Maybe via an extension? I could use Copy Work Item for the parent, but I'd still need to create all the children manually.
Yes, it`s possible with Excel (Add linked backlog items and tasks). You can do next steps:
Create new excel sheet and connect to tfs.
Add needed child-parent levels.
Paste prepared work item structure.
Update the iteration path and any additional data.
Publish.

Sharing data between scenarios Specflow

I currently have about 15 scenarios in one feature file and want to share data between them. I thought context injection would work and it is working between steps within a single scenario but I can't get it to pass data from one scenario to another. How does everyone else achieve this ?
Short answer:
No one does this, as it's a Bad Idea™
Long answer:
If you have data valid for the whole feature, place it in the feature context. But this data can't be modified in one scenario and accessed in another.
The tests will be executed in an order determined by your test runner. Different runners may choose different orders. Execution order may be changed from one release of a runner to the next. Having temporal coupling between your tests, or implicit dependencies causes other problems as well, such as what happens if I want to run a test on its own? Now it will fail as the previous tests have not been run first. What If I want to run the tests in parallel? Now I can't as the tests have dependencies which need to be run first.
So what can I do?
My suggestion would be to use background steps (or explicit steps in your givens) to set up the data your individual scenario requires. Specflow makes reusing these steps, or have these steps reuse other steps, fairly simple. So if you need a customer and a product to create an order and you have scenarios like this:
Scenario: Creating a customer
Given a create a new customer called 'bob'
When I query for customers called 'bob'
Then I should get back a customer
Scenario: Creating a product
Given a create a new product called 'foo'
And 'foo' has a price of £100
When I query for products called 'foo'
Then I should get back a product
And the price should be £100
Scenario: customer places an order
Given I have a customer called 'bob'
And I have a product called 'foo' with a price £100
When 'bob' places an order for a 'foo'
Then an order for 1 'foo' should be created
here the last scenario creates all the data it needs. It can reuse the same step (with a different Given attribute) as Given a create a new customer called 'bob' and it can have a new step And I have a product called 'foo' with a price £100 which just calls the two existing steps Given a create a new product called 'foo'
And 'foo' has a price of £100
This ensures that the test is isolated and does not have any dependencies.
you can create a variable static IDictionary<String, Object> globalData in another class say Global.cs
Now, in scenario 1: save any object
Globle.globalData.Set("Key", Object);
in scenario 2: retrieve the object by its key and cast it into previous type
var dataFromScen1 = Global.globalData.Get("Key");
in this way you can use data from scenario 1 into scenario 2 but you will face issues during parallel execution

Applying Work Item template to an existing work item

I used the Process Editor to create a new State for User Story work items (the state of Proposed). When I create a new story it works fine, the User Story is created and the initial state is Proposed, just like I want it.
However when I open an existing User Story work item (one created before I made the change), it doesn't have the Proposed state as an option, and furthermore it will not accept it if I type Proposed in the State field.
Does this mean that any changes made to a Work Item Template will only apply for new work items going forward?
The proposed state is not in the dropdown, most likely because there is no transition from the current state of the work item to the proposed state.
Could you verify this?

In TFS (MSF Agile), How do I query for Active User Stories with all child tasks closed?

I'm currently writing a series of "Sanity Check" queries for our MSF Agile based project on TFS 2010.
The search I'm struggling with is the following:
Find all User Stories which:
- Have child tasks (or bugs)
- All child tasks/bugs are in the Closed state
- The parent User Story is not closed
The goal being to find user stories that should/could be closed but are not yet.
There doesn't seem to be a way to get the count of child tasks, if I could do that then I could search for "has child tasks, and no child task is not closed". But perhaps there is another way to get the end result I am after ?
Update: More information
My closest search to this so far is:
Team Project = #Project
And Work Item Type = User Story
And State <> Closed
and linked items that match the query below
State <> Closed
Linking Filter: Only return items that do not have the specified links
This almost gets me what I want, however it returns user stories which have no tasks attached, I do not want those to be included.
First you need to change the type of query to be "work items and Direct Links"
In the first query type the following:
Field ------> Work Item Type
Operator---> =
Value -----> User Story
In the second criteria table which is the child of work items, choose all criteria you need
Edited
See the following image

Resources