Hi,
i am using this below API to create a version in the project-
versionService.validateCreateVersion(project.getLead(), project, oldVersion.getName(), oldVersion.getReleaseDate(), oldVersionDescription, oldVersion.getSequence());
If you see the documentation -
Community moderators have prevented the ability to post new answers.
Hi,
I solved the problem by added new bunch of code.
Thanks a lot.
Regards,
Mir
@Mir,
Can share your solution (logic) :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The logic was the same where i create a project, create the version then move the issues to new project.
While setting the issues with the version i used the following to get version-
public static Object find(Collection collection, Predicate predicate)
Override evaluate method which checks for version name and returns version object.
Once the you have collected the versions then put that list in the parameter-
issue.setFixVersions(newVersionList)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As you see.. the fix version field is filled but when i open edit issue screen then it does nto appear in the pop screen.
ANy idea which code it runs when edit issue pop up screen comes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mir,
Please check this thing carefully :
1. this fix version named 'sprint ' is present which project "LETSTALKFOLLOWUP" or "LETSTALK".
2. When you are setting the fixversion ? after moving the issue or before moving.
3. If above two points are positive , then comment the move issue code in your plugin.
let the code work till version creation then after do the move issue thing manually , see what happens with fixversion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
q1) Null is working fine.Version are created in new project.OK
q2) i did system re indexing but the fix version value value comes empty in edit issue pop up.. even though its there in db as i see it comes in even issue navigator.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@mir,
can post a screen shot of view screen and edit screen , if possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
q1) i can manage with null as i have no data to find the versions.
q2) Yes, version and issue are of same proejct. in fact i see the FixVersion Value in issue view page but when i click on Edit Issue pop up comes up and the fixVersion field is empty .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@mir,
q1) Null is allowed as JiRA is also sending null in the API call. please re-check again if you are really sending null as param in it.
q2) re-index jira , then see if happens .
if re-indexing does the trick , then write a piece of re-index code in issue creation method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mir,
what is ScheduleAfterVersion parameter ?
In create version UI in JIra , you can reorder the versions by dragging to a particular position.
if thru code , you are creating a version and want to put in a particular position among the versions then scheduleafterversion will have versionid for the version after which you want to position your newly created version.
check for more details(read 'reschedule a version') : https://confluence.atlassian.com/display/JIRA/Managing+Versions
Regarding q-2,
see if the version and issue are of same project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
OK. i checked i found that -
versionService.validateCreateVersion(project.getLead(), project, oldVersion.getName(), oldVersion.getReleaseDate(), oldVersionDescription, oldVersion.getSequence());
oldVersion.getSequence() was giving not null and it was throwing a exception.
But do u have any idea wat "Long scheduleAfterVersion" param all abt?
What if i dont want to pass "null" and send some proper value , any APi which gives this value for scheduleAfterVersion?
Or is something from GreenHopper as i am still using JIRA 5.0.3?
2. As i sent a null the sprint created in a new project along with the moved issue.But when i edit the issue i dont see the value of fix version say "sprint 1" assigned in the pop editor of the issue where as it is available in the issue view screen but the values are lost in the edit issue pop up and need to be re assigned again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mir,
in the javadocs : https://docs.atlassian.com/jira/5.0-rc5/com/atlassian/jira/bc/project/version/VersionService.html
there are two validateCreateVersion() method : difference is in value of release date . one carries String and other carries Date object.
JiRA themselves validate the version creation by calling the method with release date as string.
But still they allow null in scheduleAfterVersion paramer .
But null pointer is coming in moveVersionSequences method , which gets called if the ScheduleAfterVersion paramer is not null.
Please check the parameters values you are sending.
You can see yourself , by debugging class com.atlassian.jira.project.version.DefaultVersionManager in jira source code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.