How to sync Tags to Labels with the RallyAPI and JIRA connector - ruby

I am using the RallyConnector to sync user stories and defects with JIRA.
https://help.rallydev.com/jira-5-installation-user-guide
here is my field mapping
<FieldMapping>
<Field><Rally>Name</Rally> <Other>Summary</Other></Field>
<Field><Rally>Description</Rally> <Other>Description</Other></Field>
<Field><Rally>FormattedID</Rally> <Other>RallyKey</Other></Field>
<Field><Rally>Tags</Rally> <Other>Labels</Other></Field>
</FieldMapping>
When I added the Tags field and map it to the Labels (JIRA's version of Tags) to the connector, I get the following error:
ERROR : RallyEIF::WRK::JiraRestConnection.rescue in attempt_update - Attempt to update issue JM-25 failed, undefined method `split' for # < RallyAPI::RallyCollection:0x007fd1950b2890 #results=[]>
I suppose this has something to do with the fact that it is a list of values, and just not a single value.

Only Bugzilla and CQ connectors support tags, but not the Jira connector. It's mentioned here, in the Best Practices. You are correct that in WS API Tags is a collection.

Related

Undeclared property when creating a record via Web API In Dynamics CRM Online

I am trying to create an entity in Dynamics CRM online with a custom lookup field. Even after providing the SchemaName(sg_DepartmentalProjectId) as mentioned here 'An undeclared property' when trying to create record via Web API I am still getting the same error.
An error occurred while validating input parameters: Microsoft.OData.ODataException: An undeclared property 'sg_DepartmentalProjectId' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.
Below is my JSON Post
{
"sg_invoicenumber": "SIAIR402742-416805",
"sg_accountnumber": "5400",
"sg_description": "xxxx",
"sg_fy": "20",
"sg_name": "Operational Journal: yyy - 09/20/2019",
"sg_departmentid": "CC10530",
"sg_postingdate": "2019-09-20",
"sg_invoicedate": "2019-09-20",
"sg_checkdate": "2019-09-20",
"sg_paidfulldate": "2019-09-24",
"sg_amount": 5597.4,
"sg_effectivedate": "2019-09-20",
"sg_DepartmentalProjectId#odata.bind":"/sg_departmentalmatters(e9c31cec-deff-e411-80c5-0050569732ae)"
}
Please Download Odata Metadata from the Developer resources & verify the exact casing. Jason Lattimer also confirmed that the bug while investigating the CRM REST builder issue:
I've come to figure out the metadata is in fact not the source of truth - it's the CSDL
I know it's super annoying when this is working different & getting solved by different solutions. Make sure you verify in all these places for the custom lookup attribute.
Microsoft reference: CSDL $metadata document
I had the same problem, but in my case using the schema name didn’t work. I believe it’s because my field is setup as a navigation property to either of two different entities. I found the correct name by pulling the metadata for the entity from the API and looking at the navigation properties. There were two navigation properties defined for this field, one for each target entity, so I had to use the name of the correct one in my payload.
<NavigationProperty
Name="parentcustomerid_account"
Type="mscrm.account"
Nullable="false"
Partner="contact_customer_accounts">
<ReferentialConstraint
Property="_parentcustomerid_value"
ReferencedProperty="accountid" />
</NavigationProperty>
The correct value was parentcustomerid_account above.
I had same issue
JSON:
{
"activityid": "cbf73794-9e42-ec11-8c62-00224815945f",
"subject": "Test 22",
"new_AppointmentTypeId#odata.bind": "new_tasktypes(a97ec3cf-3e1a-ea11-a811-000d3a799417)"
}
Error I was getting:
An error occurred while validating input parameters: Microsoft.OData.ODataException: An undeclared property 'new_AppointmentTypeId' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.
Resolution:
Use Metadata Browser https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/browse-your-metadata?view=op-9-1
Find ReferencingEntityNavigationProperty from Metadata Browser for fields you need it.
Working JSON:
{
"activityid": "cbf73794-9e42-ec11-8c62-00224815945f",
"subject": "Test 22",
"new_AppointmentTypeId_Appointment#odata.bind": "new_tasktypes(a97ec3cf-3e1a-ea11-a811-000d3a799417)"
}

How to Fix Document Not Found errors with find

I have a collection of Person, stored in a legacy mongodb server (2.4) and accessed with the mongoid gem via the ruby mongodb driver.
If I perform a
Person.where(email: 'some.existing.email#server.tld').first
I get a result (let's assume I store the id in a variable called "the_very_same_id_obtained_above")
If I perform a
Person.find(the_very_same_id_obtained_above)
I got a
Mongoid::Errors::DocumentNotFound
exception
If I use the javascript syntax to perform the query, the result is found
Person.where("this._id == #{the_very_same_id_obtained_above}").first # this works!
I'm currently trying to migrate the data to a newever version. Currently mongodbrestore-ing on amazon documentdb to make tests (mongodb 3.6 compatible) and the issue remains.
One thing I noticed is that those object ids are peculiar:
5ce24b1169902e72c9739ff6 this works anyway
59de48f53137ec054b000004 this requires the trick
The small number of zeroes toward the end of the id seems to be highly correlated with the problem (I have no idea of the reason).
That's the default:
# Raise an error when performing a #find and the document is not found.
# (default: true)
raise_not_found_error: true
Source: https://docs.mongodb.com/mongoid/current/tutorials/mongoid-configuration/#anatomy-of-a-mongoid-config
If this doesn't answer your question, it's very likely the find method is overridden somewhere in your code!

AWS Ruby SDK v2, Cloudfront list_distributions, iterate over the results

I'm using the new ruby sdk (v2) for aws cloud front
I'm trying to list all of my distributions, using the list_distributions method
the response that is get is a PageableResponse,
when i try to iterate over the results it seems that i get only one page,
page = cloudfront.list_distributions
page.each do |page|
# only one page ....
end
but in the "distribution_list" hash, the "next_marker" attribute, contains the value for the request, and the "is_truncated" attribute is set to true,
if i will call list_distributions method again with the next_marker, i will get the next set of results...
why is that ?
it seems strange that i have to ways to iterate over the response ?
Thanks
I got a reply from a thread in the AWS discussions forum that said it's a bug in the SDK and it should be resolved in the next release.
Link to the issue

No signature of method: groovy.lang.MissingMethodException.makeKey()

I've installed titan-0.5.0-hadoop2 with hbase and elasticsearch support
I've loaded the graph with
g = TitanFactory.open('conf/titan-hbase-es.properties')
==>titangraph[hbase:[127.0.0.1]]
and a then I loaded the test application
GraphOfTheGodsFactory.load(g)
Now when I'm trying to create a new index key with:
g.makeKey('userId').dataType(String.class).indexed(Vertex.class).unique().make()
and I got this error:
No signature of method: groovy.lang.MissingMethodException.makeKey() is applicable for argument types: () values: []
Possible solutions: every(), any()
Display stack trace? [yN]
Can someone help me with this ?
when I want to see the indexed keys I see this
g.getIndexedKeys(Vertex.class)
==>reason
==>age
==>name
==>place
I'm not completely following what you are trying to do. It appears that you loaded Graph of the Gods to g and then you want to add userId as a new property to the schema. If that's right, then i think your syntax is wrong, given the Titan 0.5 API. The method for managing the schema is very different from previous versions. Changes to the schema are performed through the ManagementSystem interface which you can get an instance of through:
mgmt = g.getManagementSystem()
The syntax for adding a property then looks something like:
birthDate = mgmt.makePropertyKey('birthDate').dataType(Long.class).cardinality(Cardinality.SINGLE).make()
mgmt.commit()
Note that g.getIndexKeys(Class) is not the appropriate way to get schema information either. You should use the ManagementSystem for that too.
Please see the documentation here for more information.

Trying to migrate Rally Defect Requirement to JIRA

Using the Rally/JIRA connection I am trying to synchronise them.
https://help.rallydev.com/jira-5-installation-user-guide
I am trying to map the Requirement (UserStory) field for Defects to a custom field in JIRA.
Here are my field mappings
<FieldMapping>
<Field><Rally>Name</Rally> <Other>Summary</Other></Field>
<Field><Rally>Description</Rally> <Other>Description</Other></Field>
<Field><Rally>FormattedID</Rally> <Other>RallyKey</Other></Field>
<Field><Rally>Status</Rally> <Other>Status</Other></Field>
<Field><Rally>Priority</Rally> <Other>Priority</Other></Field>
<Field><Rally>Requirement</Rally> <Other>RallyUserStory</Other></Field>
</FieldMapping>
I am using the RallyReferenceFieldHandler to map this to a custom field
<RallyReferenceFieldHandler>
<FieldName>Requirement</FieldName>
<ReferencedFieldLookupID>FormattedID</ReferencedFieldLookupID>
</RallyReferenceFieldHandler>
I am getting this error message:
RallyEIF::WRK::JiraRestConnection.block in validate - Field Handler field_name Requirement not found
would you mind posting more of your config with all of your field mappings and field handlers?
My only guess at the moment is that your is inside your block. If it were in the wrong place, you might get an error like you are seeing. It should be inside a block - for example:
<Connector>
<FieldMapping>
<Field><Rally>FormattedID</Rally><Other>OtherFormattedID</Other></Field>
<Field><Rally>Requirement</Rally><Other>RallyUserStory</Other></Field>
</FieldMapping>
<RallyFieldHandlers>
<RallyReferenceFieldHandler>
<FieldName>Requirement</FieldName>
<ReferencedFieldLookupID>FormattedID</ReferencedFieldLookupID>
</RallyReferenceFieldHandler>
<RallyFieldHandlers>
<OtherFieldHandlers>
<!-- Other Field Handlers here -->
</OtherFieldHandlers>
</Connector>

Resources