Release synchronization across spaces

I'm having issues to synchronize two Release fields across different Octane spaces. Let me to summarize the situation:

  • Defined Release names in both spaces are equal. Of course IDs are different.
  • In the connection, I have defined an empty mapping to synchronize "Release" entities between both spaces, so MFConnect can "see" the Release values in both spaces
  • In the same connection, another mapping is defined and called Defect. This mapping is trying to synchronize the Release field ("Detected In Release") between the two spaces. Bidirectional between Master to Target.

I was expecting that this should be sufficient, but it is not. When connection starts, i get the following message in the target ticket:

  • Failed Action: GetValueField:
  • Failed property: detected_in_release
  • Failure cause: Failed to find itemId=4013

I understand that the message means: target space is unable to translate the Release ID to the new release value in the target space. But I'm not even sure about this.

How could I fix this issue? What I'm missing? 

  • Suggested Answer

    0  

    Hi Eduardo.

    You are on the right path.
    Connect associates items in different endpoints via cross-references in the internal DB, only.
    As such, items having the same name alone does not suffice for Connect to associate them.

    Normally, the xrefs are created when Connect initially syncs an item from one side to the other (creates it on the other side and creates a matching xref along with it).
    In your case, you already seem to have release objects on both sides - but Connect is not recognizing this situation, as it does not have the xrefs to match.

    There are several ways how you can achieve the association - with or without xrefs:

    1. If this is a one-time need, and future release items will be synced by Connect, then you can create an xref file and import it:
      https://admhelp.microfocus.com/connect/en/24.1-24.2/Online/Content/Topics/cross-references.htm
    2. If you will continue to make sure manually that matching release items with matching names exist, then you can use a Calculated Value and ignore the xref topic entirely:
      https://admhelp.microfocus.com/connect/en/24.1-24.2/Online/Content/Topics/calculated-values.htm
      https://admhelp.microfocus.com/connect/en/24.1-24.2/Online/Content/Topics/Scenarios.htm#mt-item-4
      The above is not exactly your situation, but close - you should be able to adapt the Calc Value from there...
      This will search within the scope known to Connect, instead of using xrefs.
      Also check if you need to account for situations where the item (defect) is not newly created but when the release is re-assigned during its lifetime.
    3. Use the MatchByName script to automate what item #1 mentions as manual activity (creating xrefs)
      https://admhelp.microfocus.com/connect/en/24.1-24.2/Online/Content/Topics/scripts_mappings.htm#mt-item-2

    Best,
    Dom.

  • 0 in reply to   

    Hi Dominique

    Thanks for your answer. From your 3 options, 2nd looked the most interesting, but still not working. I've been trying different combinations to assign the calculated value, but all of them returns exactly the same error message as before (Failed Action: GetValueField). 

    Option 1 however gives some hints: why the xrefs are not generated automatically? How could I force a full synchronization? Exporting the xrefs I can confirm that the map between Release fields in these two Octane workspaces is not being generated.

    The point is that I have another connection pretty similar to the one I'm refering and synchronizing a different release field. Surprisingly this one is working correctly with no special magic such as the calculated value options or special xref imports.

    Thanks again

  • 0   in reply to 

    Hi Eduardo.

    The approach #2 does always works, if the needed releases already exist on both sides, and if these needed releases are in scope for Connect (e.g. via empty mapping), and if the Calculated Value expression(s) are correct.
    "FindFirst" or "FindFirstAndThrow" are there exactly for scenarios like this.

    For #2, as said, you have to adapt the samples given in the online doc to your exact situation.
    See if in your situation, there actually is a field "releaseName" as is used in the example.
    See if you need to deal with the situation of no release (empty) being assigned (potentially via two Calc Values and if statements).
    ...and so on...

    Re xref creation: Connect only ever creates xrefs itself when it actually creates items in an endpoint. Otherwise you need to go the way of #1 (manual import of an xref file) or #3 (use utility to create the xrefs for you).
    For now, this is how Connect is designed - it is very cautious in assuming any kind of association between elements to prevent unintentionally modifying the wrong items in an endpoint.

    Re your last remark: If you think that you have two connections that should behave the same, but one works and one doesn't, then I'd recommend creating a support case and let our team have a look at it.

  • 0 in reply to   

    Thanks Dominique, I really appreciate your help.

    Everything clear about Option #1. I'm trying right now to confirm if someone imported manually the xrefs before me, but I assume that this is the most logical explanation.

    About Option #2, I'll try to detail you as best as possible what I'm doing. 

    • Releases exists between both spaces, and they have the same name
    • releaseName exists in both spaces, and it is under synchronization in the Defect Mapping.
      • Actually, I don't understand what's this field, since my defined Defect form doesn't contain this field. Not even in the API dump. Is this a built-in field? And doing what?
    • Defect mapping is uni-directional: Master to target, but "detected_in_release" field (the problematic one) is intended to be bi-directional.
    • Empty Release mapping is created and bi-directional

    So your first two conditions are met. Slight smile

    Now the Calculated Value expression, which looks the hard part. Probably I'm doing something wrong, but it's not easy to follow the documentation. It is not clear for example when to use "My" or "myItem".

    • Since I'm using the calculated value expression, I'm removing the "detected_in_release" field from the Defect mapping. I assume that since now is set by this calculated value, it is not needed an actual synchronization. Right?
    • In the Calculated Value form (both Target and Master), I've tried the following things: 
    1. Try one:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: FindFirst(Release)
      4. From: Detected in release Equals "otherItem.detected_in_release"
    2. Try two:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: FindFirst(Release)
      4. From: Detected in release Equals "myItem.detected_in_release"
    3. Try three:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: FindFirst(Release)
      4. From: Detected in release Equals "My->Detected in release"
    4. Try four:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: FindFirst(Release)
      4. From: Detected in release Equals "My->detected_in_release"
    5. Try five:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: FindFirst(Release)
      4. From: Detected in release Equals "Other->detected_in_release"
    6. Try six:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: FindFirst(Release)
      4. From: Detected in release Equals "Other->Detected in release"
    7. Try seven:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: Other->Detected in release->Name
    8. Try eight:
      1. When: EMPTY
      2. Set field: "Detected in release"
      3. To value: My->Detected in release->Name"

    At this point I stopped. In all cases, the error is the same: GetValueField, but nothing complaining that my expressions were not correct. So I understand that I still need to import the xrefs.

    What I'm doing wrong? Disappointed

  • Verified Answer

    +1   in reply to 

    "My->" is like self. However, it is partially optional "My->Other->something" is the same as "Other->something"..

    A Calc Value is always defined and executed on the destination side of a sync.
    If the sync of a field is to be bi-directional, you likely need Calc Values on both sides.
    Also, as it is always destination side, to get to any kind of data from the source side, you must use the "Other->" syntax.
    As such, your expressions 2, 3, 4, 8 will not work.

    "myItem" and "otherItem" are for use within JavaScript expressions ("Eval(...)").
    As such, your expressions 1,2 will not work.

    "Detected in release" is a field of type reference - a full release object item is "behind" it.
    You cannot compare it (the full object) directly. Instead, you need to get to a release field that you can compare (name, id, etc.).
    As such, your expressions 1-6 will not work.

    As "Detected in release" is a reference field, you cannot assign a simple string value to it.
    As such, your expressions 7, 8 will not work.

    The field "releaseName" only exists for Octane/ValueEdge endpoints, and it is a "fake" field.
    Basically, it is an automatic "Release->Name" expression. And it is writable, as well.
    However, you are interested in detected in release not in the "Target Release" field - so it is of no import nor impact here. You should leave its mapping as it was.

    Instead, try something like this (assuming destination is Octane, i.e.: Other-> goes to Jira):

    When: EMPTY
    Set field: "Detected in release"
    ^^ the field in Octane
    To value: FindFirst(Release)
    ^^ the release type in Octane
    From: Name Equals "Other->Detected in release->Name"
    ^^ compare "Name" field of Octane "Release" type to Other/JiraBug->JiraReleaseReferenceField->NameFieldOfReleaseItem
    --or--
    From: Name Equals "Other->Detected in release.label->Name"

    And, as mentioned, if it starts working for you, you might then also want to consider using a WHEN clause (IsNew, IsEmpty, etc.).
    For example, the "->Name" part of "Other->Detected in release->Name" will fail if the detected in release field is empty.