5 answers
- 10-1
Thanks for all your contribution. This is how I finally solved it:
Outgoing
replica.customFields."Kunden" = issue.customFields."Kunden"
Incomming
def organisations = replica.customFields."Kunden".value?.collect{ a -> a.value } issue.customFields."Organisationen".value = organisations
CommentAdd your comment... - 10-1
Another question on this topic.
From JIRA, we have a Select list custom field on a screen when we Exalate to JSM.
We select an 'Organization' on this screen upon Exalation, the issue then gets Synced in JSM.We want this Organization we select to be populated on the JSM ticket, this should go to the Organization custom list on JSM, which is managed by Insight. I think the complication potentially comes from the fact that the Organization list is managed by Insight.
At the moment, the Organization field on the JSM ticket is blank. You can type in an Organization in this field and it will populate.
This is what we have in our JIRA Connections outgoing script:
replica.customFields."Organizations" = issue.customFields."Organizations"
And this under our JSM incoming script:
issue.customFields.Organizations?.value = replica.customFields.Organizations.value?.collect { org -> org?.organizationName }?.findAll()
Hope this helps.
- Francis Martens (Exalate)
Hi Roy Chapman
Can you detail out what is not working at the moment. Is the organisation field not populating when doing an incoming sync? - Samuel Carter
Francis Martens (Exalate) Correct, the organization field is blank. Organization should be populated with the information from the select list on the previous screen.
- Francis Martens (Exalate)
Hi Samuel Carter
Can you check if the field value assigned to the organizations field is what it should be.
You can do 2 actions
a) check out the right hand side calculated value by doingdef targetOrg = replica.customFields.Organizations.value?.collect { org -> org?.organizationName }?.findAll() debug.error("Targetorg = ${targetOrg}")
When a sync transaction is triggered, an error will be raised containing the targetOrg - is it what you expect
b) Check out what value can be assigned to Organizations by hard coding something
I believe Organizations is an array, so you could try something likeissue.customFields.Organizations?.value = [ "Google", "Apple" ]
Give it a try. - Samuel Carter
Hi Francis,
Thanks for your suggestion and apologies for the delay in getting back to you.
Please see below for results of each solution:
a) Returns the following error 'Cannot get property 'value' on null object'
b) When I put this in, it will successfully assign ALL the values which are included in the array, so Organizations field on JSM has 'Apple', Google' and 'Microsoft' assigned to it.
Thanks and regards,
Sam
- Francis Martens (Exalate)
Hi Sam,
Now it is my turn to be apological for the late reply.
a) it means that issue.customFields.Organizations is null - is this to be expected?
b) Should Microsoft not be part of it? - Francis Martens (Exalate)
From Roy Chapman
I have played with the debugging.
Previously the debug read
def organisations = replica.customFields."Organizations".value?.collect{ a -> a.value } debug.error("Targetorg = ${organisations}")
And generated
Targetorg = []
I have changed to read
def organisations = replica.customFields."Organizations".value?.collect{ a -> a.value } def Royorganisations = replica.customFields."Organizations" debug.error("Targetorg = ${Royorganisations}")
And get this debug.
Targetorg = com.exalate.basic.domain.hubobject.v1.BasicHubCustomField@8ddb1275
What does this mean? Does this mean that a value is coming across? If so, where is the value? (I selected TAP as the value)
- Francis Martens (Exalate)
Hi Roy Chapman
com.exalate.basic.domain.hubobject.v1.BasicHubCustomField@8ddb1275
is how groovy denotes an object. The class is BasicHubCustomField and its address is ddb1275
The reason why you get this, is because you assign the customField to the variable Royorganisationsdef Royorganisations = replica.customFields."Organizations"
Note that this has nothing to do with the collect operation performed on replica.customFields."Organizations"
That result is assigned to the variable 'organisations'
I would rather todebug.error("Targetorg = ${organisations}"
And see what gives.
CommentAdd your comment... - 10-1
Hi
add Davis symbol "?"
issue.customFields."Organisationen"?.value = replica.customKeys?."Kunden".value
CommentAdd your comment... - 10-1
Hi,
i have a similar challenge;
1. sync a custom field text to Organization
2. sync a single select option to Organization
Does anyone have an idea how this can be done?
Many thanks in advance
Cristina
- Cristina Mogos
Hi Francis,
the solution provided in Exalate documentation works fine when sync goes from Jira Service Desk to Jira SW (Custom Text field).
i need the other way around now, i have Custom text filed value → JSD Organization; respectively Single select → JSD Organization.
Many thanks
Cristina
- Francis Martens (Exalate)
Hi Cristina Mogos
I thought that a video might help showing how organization does work in my case.
But maybe I'm not fully grasping the problem so let me know. - Cristina Mogos
Hi Francis,
Thank you very much for the video.I will try to explain more about the Case.
There are 2 Jira instances : 1 Jira Service Desk (JSD) and one Jira Software (JSW). In JSD there is the system field Organization. In JSW there is no system field Organization, and we use a custom field for that (Custom field text or single select, depending on the project).
From JSD to JSW the sync works fine, as you also explained in the video.
From JSW to JSD i did not find a way to do it; from Text field to Organization ; from single select to Organization.
hope it is more clear.
thank you very very much for your time
Cristina
- Francis Martens (Exalate)
The video highlighted how you can set the organizations in the JSD project. Apparently not clear enough
Anyway - try followinga) in the incoming sync on the JSD side add following code
issue.customFields.Organizations.value = ["Organization Name1", "Organization Name2"]
b) Ensure that both organizations exist in the JSD configuration
c) Sync a change from JSW to JSDd) See if the organizations have been set.
Next would be to develop a mapping between the select list and the organizations field. If above fails - let me know. - Cristina Mogos
Hi Francis,
I'm back again...
Now i can create an issued from JSW to JSD in the right organization. Still, JSD users in that organization do not see the issue. I assume is because the issue has to be "shared with organization". How do i enforce this after issue creation (via Exalate)?
(shall i open a different queue for this question please let me know.)
Best and thanks
Cristina
CommentAdd your comment... - 10-1
Hi Paul Schmidt
You lost me here.
On left you have a checkbox customfield, which contains organisation namesOn right, you would like to select the corresponding organisations based on the values in the left customfield
Is this correct?
- Francis Martens (Exalate)
OK - lets take it step by step.
a) Ensure that the customer information is transmitted correctly from Left to Right
b) Ensure that it is applied correctly on Right.
Can you confirm that the information is arriving on right (ie. like an array) .
Check the remote issues tab for more detail
(assuming you are on a Jira Server to Jira Server environment) - Francis Martens (Exalate)
Can you try something like
issue.customFields.Organizations.value = replica.customKeys.Organizations
- Paul Schmidt
I tried the following variants:
issue.customFields."Organizations".value = replica.customKeys."Kunden" issue.customFields.Organizations.value = replica.customKeys."Kunden"
Both lead to the following exception on the right side (Service Desk) when checking a new item on the left side:
Cannot set property 'value' on null object
- Francis Martens (Exalate)
Paul Schmidt - i missed your latest comment.
> Cannot set property 'value' on null objectIt means that Organization cannot be found. Can you confirm the name in the custom field list
Is this Jira Cloud or Jira Server, and in case of server - what version?
We will try to reproduce - Paul Schmidt
Hi Francis Martens (Exalate) ,
We're running Jira Server 8.11.1 on the left side and 8.5.0 on the right side. Exalate version 5.0.3 on both.
The field Organizations is called Organisationen in the custom field list due to our German installation.
I adapted it to the following. Now I don't get an error, but the field is not synchronized.
Left
replica.customFields."Kunden" = issue.customFields."Kunden"
Right
issue.customFields."Organisationen".value = replica.customKeys."Kunden"
- Francis Martens (Exalate)
Ah - good news.
You should set the value - can you try?
issue.customFields."Organisationen".value = replica.customKeys."Kunden".value
Also make sure that the organisation is available on the target. It must be exactly the same.
- Paul Schmidt
Hi Francis Martens (Exalate) ,
When I follow your last suggestion, the following happens:
- When I set an Organization on the left (whose name does exist on the right), it is not updated on the right (but no error is thrown).
- When I set no Organization on the left, an error is thrown:
Script error for issue XXX. Details: Cannot get property 'value' on null object. Error line: Script15.groovy:46
Also, I am a little confused: When do I use customKeys and when customFields?
CommentAdd your comment...
Hi,
I'm looking for a way to synchronize a multi-option checkbox to the helpdesk's Organizations field.
This article describes how to sync from the Organizations field to a text field, but not how to sync the other way around. https://docs.idalko.com/exalate/display/ED/How+to+sync+%27Organization+Names%27+to+the+text+custom+field
I also know how to sync the Organization names to a multi-option checkbox, but I don't know how to populate changes from that checkbox back to the Organization field. This is how I synchronise Organization to custom field called Kunden (multi-option checkbox)
Outgoing
Incoming
Hopefully, someone can help,
Paul