How to set task level custom field value using jsom in project server 2013 ? - custom-fields

Is there a way to set a task level custom field value programmatically using jsom in Project Server 2013?
Please advise.

For anyone who's stuck on this, here's what is used.
set_item(your customGUID, value)

Related

TF400930: The reporting attribute is inconsistent between the imported XML and what is currently configured for the field

We've just upgraded from TFS 2015.2 to TFS 2017.3 and we're running in to an issue when creating new team projects.
For some reason, we're getting the following error in the error log when we try to create a new team project:
[09:54:24.797] Importing work item types
[09:54:25.663] [Error] TF400930: The reporting attribute for field Microsoft.VSTS.Common.StateChangeDate is inconsistent between the imported XML and what is currently configured for the field. Correct the field configuration in the XML and try again.
[09:54:25.667] Microsoft.TeamFoundation.WorkItemTracking.Server.LegacyValidationException: TF400930: The reporting attribute for field Microsoft.VSTS.Common.StateChangeDate is inconsistent between the imported XML and what is currently configured for the field. Correct the field configuration in the XML and try again.
[09:54:25.667] at Microsoft.TeamFoundation.WorkItemTracking.Server.ServerMetadataProvisioningHelper.ThrowValidationException(String message)
[09:54:25.667] at Microsoft.TeamFoundation.WorkItemTracking.Common.Provision.UpdatePackageField.CheckDefinitionConsistency(XmlElement fieldElement)
[09:54:25.667] at Microsoft.TeamFoundation.WorkItemTracking.Common.Provision.UpdatePackageField.Update(XmlElement fieldElement)
Here is the result from witadmin:
Field: Microsoft.VSTS.Common.StateChangeDate
Name: State Change Date
Type: DateTime
Use: --- (Bug, Shared Steps, Task, Test Case, User Story, Issue, Change Request)
Indexed: False
Reportable As: dimension
And from a search with Notepad++:
Notepad++ Search for Microsoft.VSTS.Common.StateChangeDate
As you can see from the search, it is being "reportable" as a dimension, which is what witadmin is saying the current attribute is.
Any idea on what we're doing wrong?
Thanks!
I checked on my side, by default the reportable attributes are not set in the Workitem definition files (.xml files).
So, please try to remove the attribute reportable = "dimension" from all the Wits. Then import the Wits and try it again.
If that still not work, you can try removing the Microsoft.VSTS.Common.StateChangeDatedefinition from these work items, it's a standard field which will be added to all your work item types automatically.
Reference this similar thread : Tfs project creation results in error: TF400930: Field 'System.ExternalLinkCount' is defined multiple times

How can I get value "RequestedBy" in tfs 2013 build?

In tfs 2010 build, it's easy to get that vale using "BuildDetail.RequestedBy". what's the equivalent in TFS 2013? I couldn't find "BuildDetail" even.
It's still build detail. However, in the new templates a lot of the complexity is hidden by default. Use the GetBuildDetail activity to retrieve the variable you need.
Thank you MrHinsh
It's very good suggestion!! Really appreciated!!
The value of "RequestedBy" is actually required by powershell that need to be invoked at later stage to log people name whoever trigger the build.
The following steps are what I've done to make "RequestedBy" value available in powershell script:
In TfvcTemplate.12.xaml, create variable "myBuildDetails".
Drag "GetBuildDetail" into template and specify "myBuildDetails" as result of it.
Modify "Run optional script after Test Runner" property "EnvironmentVariables", set it's value to "New Dictionary(Of String, String) From {{"RequestedBy", MyBuildDetails.RequestedBy}}"
In my ps1, the value can be retrieved by "$Env:RequestedBy"
It's not perfect solution, but it's working.
Instead of modifying build template,I though if we could inject expression something like "$(myBuildDetail.RequestedBy)" from script argument of build definition would be much tidy solution.

Set [Embed] attribute value dynamically

I am new to Action script.
Is there any possibility to set the source attribute value dynamically at run time?
for e.g
in the code
Embed(source="assets/images/image.pdf",mimeType="application/octet-stream");
I need to set
source="set pdf file name using a variable or reading from config xml"
Please provide some example snippets or links for reference
Thanks in advance.
Thanks
SRR
Maybe Conditional Compilation will get you some way to achieving what you want.

Set a default iteration path for a work item type on TFS

I try to tune my Team Foundation 2005 work items.
We have 5 iterations paths in the "Bug" work item type.
I would like it to default to a specific value, for example Iterations.Iteration2
I tried to add a DEFAULT rule in the work item type editor but couldn't set the iteration path.
How can I do that?
I'm getting the same error with TFS 2010 when I try to set a default rule for a work item type for a default iteration path.
It seems the rules engine for work items unfortunately doesn't allow this (as explained by this post and others I've seen around).
Create a Work Item Template.
If you're using VS, you'll need the Power Tools. If you're using the web interface, the feature is already built-in.

Problem related to TFS workItem.Fields

i am getting following error,while accessing teamfoundation defect tracking application
"A field definition Symptom in the work item type definition file does not exist. Add a definition for this field or remove the reference to the field and try again."
can any body help?
Thanks
Suneetha.
The work items types definition must have been modified : the "Symptom" type has probably been renamed or deleted.
This can be done using the TFS Power Tools, if you are the admin on the TFS server.

Resources