Answer by André Leroy-Beaulieu Castro on 24 October 2019
Hi Samip,
I believe the problem is in the following lines of your script:
if (replica.typeName != issue.type.name)
This isn’t working as you’d expect, you can only use .typeName when you are creating a new issue, the replica’s .typeName field is always empty. You should use the following:
if (replica.type.name != issue.type.name)
Let me know if this solves things for you.
Thanks,
André
Comments:
Samip K Banker commented on 24 October 2019
André Leroy-Beaulieu Castro :
I had replica.type.name before but then it complained… so I changed to “replica.typeName”. I know the script is going in the if loop as its hitting this exception in the if loop
//throw new IssueTrackerException("incomming issuetype = " + replica.typeName + " current issuetype = " + issue.type.name)
Samip K Banker commented on 25 October 2019
André Leroy-Beaulieu Castro :
Any update on this? we are going live in our project using Exalate mid next week and we are struggling to set this up.
~Samip
André Leroy-Beaulieu Castro commented on 25 October 2019
If this doesn’t seem to work, please open up a support ticket and I will assist you there, and when we get to the bottom of it I will post the final answer here (old community)
After I added the groovy file I don’t see any error but I don’t see any transition happening.
Below is my code in the incoming Sync
… some code before this…
//https://docs.idalko.com/exalate/display/ED/How+to+move+issues+automatically
if (replica.typeName != issue.type.name)
{
//throw new IssueTrackerException("incomming issuetype = " + replica.typeName + " current issuetype = " + issue.type.name)
Move.move(
//moveStatusMapping:
[“Bug workflow” : [“Enhancement workflow” : [“New”:“New”,“On Hold”:“On Hold”] ] ],
true, //sameStatusIfNotInMapping
issue,
issue.project.key, // the key of the project where the issue is moved to here
replica.typeName // the name of the issue type where the issue is moved to
)
}
else
{
//do something else
}
… some code after this…
Do I need to put this code in specific place (top or bottom)? I do see other changes that are being send to are getting added to the issue… but issue type is not being changed. I also don’t see error message in the exalate or Jira logs…
What am I doing wrong?
~Samip
Comments:
Samip K Banker commented on 24 October 2019
André Leroy-Beaulieu Castro :
Any update on this… we are currently blocked… any help is appreciated.