You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on migrating from TFS2018 to DevOps Server2020. In TFS, there isn't much organization with projects and areas, just one project with one area for all the repositories. In DevOps, we're trying to have a little more structure with multiple projects, and multiple areas within each project.
In TFS, the stories were differentiated in the title, "Product - Story Title" . I'm using the RegexFieldMap to remove that part of the title, which is simple enough:
is there anyway to set the value of a target field based on the contents of a source field, without without appending the source field value to the target field value?
Something like this...
I think it would be simple to just copy the current RegexFieldMap, CustomRegexFieldMap? that lets the user define their own Regex expression, rather than just calling Regex.Replace() ?
I can submit a pull request for a something like this if there's interest. But I'm coming up against a deadline to have this migration done by, and was wondering if there is any way I can accomplish my goal as is?
internal override void InternalExecute(WorkItem source, WorkItem target)
{
Regex rgx = new Regex(Config.pattern);
if (source.Fields.Contains(Config.sourceField) && source.Fields[Config.sourceField].Value != null && target.Fields.Contains(Config.targetField))
{
if (rgx.IsMatch(source.Fields[Config.sourceField].Value.ToString()))
{
target.Fields[Config.targetField].Value = rgx.Replace(source.Fields[Config.sourceField].Value.ToString(), Config.replacement);
Log.LogDebug("FieldValuetoTagMap: [UPDATE] field tagged {0}:{1} to {2}:{3} with regex pattern of {4} resulting in {5}", source.Id, Config.sourceField, target.Id, Config.targetField, Config.pattern, target.Fields[Config.targetField].Value);
}
}
}
With this, then you can gust supply a regex like ^.* Project - .*$ which would select an entire line that contains 'Project - ' to be replaced by the replacement string.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on migrating from TFS2018 to DevOps Server2020. In TFS, there isn't much organization with projects and areas, just one project with one area for all the repositories. In DevOps, we're trying to have a little more structure with multiple projects, and multiple areas within each project.
In TFS, the stories were differentiated in the title, "Product - Story Title" . I'm using the RegexFieldMap to remove that part of the title, which is simple enough:
is there anyway to set the value of a target field based on the contents of a source field, without without appending the source field value to the target field value?
Something like this...
I think it would be simple to just copy the current RegexFieldMap, CustomRegexFieldMap? that lets the user define their own Regex expression, rather than just calling
Regex.Replace()
?I can submit a pull request for a something like this if there's interest. But I'm coming up against a deadline to have this migration done by, and was wondering if there is any way I can accomplish my goal as is?
With this, then you can gust supply a regex like
^.* Project - .*$
which would select an entire line that contains 'Project - ' to be replaced by the replacement string.Beta Was this translation helpful? Give feedback.
All reactions