Is "Move" a seperate script we need?

Originally asked by Samip K Banker on 21 October 2019 (original question)


I came across this article and I am error when a issue moves from Bug to Task (issue Type)…

https://docs.idalko.com/exalate/display/ED/How+to+move+issues+automatically

Based on the error it suggests that “No such property: Move for class”…

Where can I get the helper class Move ?


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

Hi Samip,

Can you try this two things please:

  1. Show us how it fails using replica.type.name
  2. Replace your usage of Move.move(…) with Move.move(issue, issue.project.key, replica.type.name, replica.status.name)

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)

Thanks,

André

Answer by Samip K Banker on 22 October 2019

Andre:

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.

~Samip

Answer by André Leroy-Beaulieu Castro on 21 October 2019

Hi Samip,

Here is the Move.groovy script you need to add to your external scripts library :smile:

Thanks,

André

Move.groovy (old community)


Comments:

Samip K Banker commented on 22 October 2019

Thanks. Let me try that out and let you know if it works.