Wrong "ReflectedWorkItemIDFieldName" while migrating Azure DevOps Work Items - azure-devops-migration-tools

I am testing the azure-devops-migration-tools and have create a project using https://azuredevopsdemogenerator.azurewebsites.net/ (Parts Unlimited). I have generated the configuration.json and changed the Source and Target so I can test a migration, but I'm getting errors while migrating Work Items.
[15:14:41 ERR] Error running query
Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «ReflectedWorkItemId».
I've tried different options on the "ReflectedWorkItemIDFieldName" field, Scrum, Basic, Agile, Custom, empty but am still unable to migrate the work items.
How can I get the value to put on this field for the specific project?
Thanks,
Bruno

Quick Solution: Most ADO instances use the prefix 'custom' for new fields. Try "Custom.ReflectedWorkItemId" in your configuration.json to see if that resolves the problem.
More details: It's hard to tell without an actual configuration.JSON file to review. One possible problem is that you need to use the actual and full internal 'Name' of the ReflectedWorkItemID field. This doesn't show in ADO, or the Process Template when created. The recommendation is that you create a query referencing your custom field, and export the WIQL file (query file). Once you export the WIQL file, you can then open the file and see the full syntax of the custom field.
Exporting Queries: If you don't know how to do this, it can be done with VisualStudio. If you don't know how to do that, you can install this extension. It's a handy WIQL import/Export and editor. Install, and your ADO Queries with have an Edit in WIQL Editor option. Create a query that exposes your 'ReflectedWorkItemID' as a column, then edit that query in the WIQL editor and see the full names of the Reflected Work Items ID Feild. https://marketplace.visualstudio.com/items?itemName=ottostreifel.wiql-editor
SELECT
[System.Id],
[System.WorkItemType],
[System.Title],
[System.AssignedTo],
[System.ChangedBy],
[Custom.ReflectedWorkItemId]
FROM workitems
WHERE ...

I found a possible solution. I have created a custom process, change the process from the projects to this new one and add a new field. This is the field I'm using on the configuration.json and now I'm able to migrate work items

To make the migration in the "ReflectedWorkItemIDFieldName" you must do:
"Organization Settings" -> Process -> Select the process where you project are (Basic, Scrum, Agil, or CMMI).
then click on the 3 dots and create a new Inherited process.
Then with the inherited process, you are able to create a new field for each work item type. The name that you type (could be "IronMan") that name will be in your configuration file.

Related

How can i create a Dynamic Multi-Select List in hippo cms?

I am trying to create a Dynamic Multi-Select List. I tried to add a DynamicDropdown and added Multiple in Fields properties but throws an error:
An error has occurred, sorry for that.
java.lang.IllegalStateException:
org.onehippo.forge.selection.frontend.plugin.DynamicDropdownPlugin
does not support fields that are multiple: please use
org.onehippo.forge.selection.frontend.plugin.DynamicMultiSelectPlugin
for that. Field name is *. Failed to instantiate plugin class
'org.onehippo.forge.selection.frontend.plugin.DynamicDropdownPlugin'
for wicket id
'home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown-preview.cluster..plugin.home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown.cluster.default.service.wicket.id'
in plugin
'home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown-preview.cluster..plugin.home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown.cluster.default.plugin.root'
(JcrPluginConfig:/hippo:namespaces/system/DynamicDropdown/editor:templates/default/root)
Indeed the DynamicDropdownPlugin is not meant for multi-selects, you should use the DynamicMultiSelectPlugin. Easiest to install using Essentials set=up tool, see 'Add a Selection Field to a Document Type
Using the Setup Application' at https://documentation.bloomreach.com/library/concepts/plugins/selections/configuration.html
HTH
Jeroen

Move SAP package to top level

We have a subpackage thet we want to move up to the top level, so that it doesn't have any superpackage anymore.
The 'change' dialog for superpackage does not allow an empty value:
Is there another way to do this, or does the package need to be deleted and recreated?
There does not appear to be a UI function to remove that assignment. However, you could try to do this programmatically: use CL_PACKAGE_FACTORY to load the package (you'll get an instance of IF_PACKAGE), then call SET_SUPER_PACKAGE_NAME. Haven't tried it myself, though.
Looks like it's stored in table TDEVC field PARENTCL. So you can try (at your own risk) to edit the record and remove superpackage from there.

How to link a TFS workitem to another using command line

How does one link an existing TFS work item to another using in command prompt. Is there a command line option for this in TFS. I know I can use tfpt.exe to create a workitem or modify it, but I cannot find an option to link a workitem to another.
Assuming you will use "Related" link type, this should link your work items..
[string]$tfsURL="http://tfs:8080/tfs"
[psobject] $tfs=[Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($tfsURL)
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.WorkItemTracking.Client")
$wit=$tfs.Getservice([Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore])
$item1=$tfs.WIT.GetWorkItem(1)
$item1.Open()
$item2=$tfs.WIT.GetWorkItem(3)
$linkType=$tfs.WIT.WorkItemLinkTypes.Item("System.LinkTypes.Related")
$witLink=New-Object Microsoft.TeamFoundation.WorkitemTracking.Client.WorkitemLink($linkType.ForwardEnd,$item2.Id)
$item1.WorkItemLinks.Add($witLink)
$item1.Validate()
$item1.Save()
$item1.Close()

Maximo - Adding elements to a CustomMboSet using scripting

Is it possible to add to a CustomMboSet in Maximo using scripting? I am writing a custom application using a custom object called TIMESHEET. As part of the application I am writing a (Jython) script that needs to dynamically build up an MboSet (a set of TIMESHEETs). The code retrieves an existing CustomMboSet and attempts to add elements to it. It works when using an out of box MboSet, but when I try to run the same code on a custom MboSet it does not seem to work. No error is thrown, but code below the offending line is not run.
In other words, this works (LABTRANS is an out of box MBO):
myMboSet = mbo.getMboSet("LABTRANS")
newMbo = myMboSet.add()
# Set attributes on newMbo, everything is happy
But this does not (TIMESHEET is a custom MBO):
myMboSet = mbo.getMboSet("TIMESHEET")
newMbo = myMboSet.add()
# Code does not execute after the above line
Anyone have any insight as to why I am seeing this behavior? Does the Maximo scripting framework simply not support the dynamic building up of CustomMboSets? Any help is appreciated. Thanks.
You need to make sure that the relationship exists between the Current MBO and the Custom MBO in the database configuration otherwise it will not work.
Alternatively you can use the following code to create an new mboSet on the fly:
timeSheetMboSet = mxServer.getMboSet("TIMESHEET", userInfo)
mbo.getMboSet(RELATIONSHIPNAME).
LABTRANS and TIMESHEET must be the relationship names to the object in auto script.
If you want to get/add records in any object, use
mxServer.getMboSet(OBJECTNAME, userInfo)
A bit more explanation. You can create your own custom relationship from within your automation script. The trick is to make sure it's not already existing. That's why I use a dollar sign for mine.
variable = mbo.getMboSet(tempRelationshipName,Object,where clause)
previousPhaseSet = mbo.getMboSet("$wophasetranstemp1", "exitdate is null")

How to update the values of Magento products using installer/update scripts and Magento abstractions?

I added a custom eav attribute to my Magento application product entity using an installer script (Basically, following the procedure described here: Installing Custom Attributes with Your Module). Now, I want to use an update script to change (populate) the values of this attribute for each product according to some criteria (based on the product category). The script I attempted to use was essentially like this:
$attributeValues = array(...) // Map from $productId to the desired $value
$product = Mage::getModel('catalog/product');
foreach($attributeValues as $productId=>$value){
$product->load($productId)->setMyAttribute($value);
$product->save();
}
My questions would then be: Is it ok to use this level of abstraction (Mage::getModel('catalog/product') and its methods) in update scripts? If it isn't, how would you recommend to change these attribute values using update scripts (without requiring sql)?
The script I used (until now) has not worked and failed with the error:
Call to a member function getStoreIds() on a non-object
in a magento core file.
I don't know if this error is a Magento bug or is a problem with how I'm using the update scripts.
I'm using Magento 1.4.0.1
Data update scripts are the way to go
Simply use a data upgrade script for this. This is a script placed in the data folder instead of the sql folder. Those scripts run later then the database structure updates, and allow access to more functionality.
Example file names:
app/code/local/My/Module/data/your_setup/data-install-0.1.0.php
app/code/local/My/Module/data/your_setup/data-upgrade-0.1.0-0.2.0.php
This is already available in Magento 1.4.
Try adding Mage::app()->setUpdateMode(false) in your sql upgrade script. e.g.
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');;
$installer->startSetup();
Mage::app()->setUpdateMode(false);
Mage::app()->setCurrentStore('your_store_code_here');
If you look in Mage::app()->getStore() you will see the following snippet that returns an incorrect store which is required for saving a product.
if (!Mage::isInstalled() || $this->getUpdateMode()) {
return $this->_getDefaultStore();
}