Find Questions…

Close ×
First time here? Check out the FAQ!

Email notifications have been disabled for all projects

srinivas patruni asked this question · 1,296 karma ·

I updated proejct names via SOAP. After that i found that email notifications have disabled for all projects. Everything else is found working. Any idea about why this has happend?

332 views

2 Answers:

Jobin Kuruvilla [Go2Group] · 80,003 karma ·

Did you accidently removed the notification schemes from the project? It is diffcult to do that 'accidently' via code though!

srinivas patruni · 1,296 karma ·

No. I have not touched that. Also observed the Default Assignee field is found as Unassigned.

Jobin Kuruvilla [Go2Group] · 80,003 karma ·

You might want to check the email server and such.

srinivas patruni · 1,296 karma ·

They are also up and running. Please find the below code snippet used for updation.

try {RemoteProject[] remoteProjects = jiraSoapService.getProjectsNoSchemes(authToken);

			for(RemoteProject project : remoteProjects){
				project.setName(project.getKey()+"-"+project.getName());
				jiraSoapService.updateProject(authToken, project);

				System.out.println(project.getName());
			}
		} catch (RemotePermissionException e) {
			System.out.println(e.toString());
		} 

srinivas patruni · 1,296 karma ·

Hi Jobin,

Any update on this please?

-Srinivas

Jobin Kuruvilla [Go2Group] · 80,003 karma ·

The above code looks fine to me and I don't think that caused you any issues. It must be something else that you have done!

srinivas patruni · 1,296 karma ·

This is absolutely what i had executed and did nothing else. Any other reasons?

Dieter · 10,710 karma ·

Hi Srinivas, I agree with Nic that your projects are without any schemes now. I have never used getProjectsNoSchemes, but if i understand the documention correctly it returns a Project object without any scheme information i.e. notificationScheme is null in this object. When you update this object it might write back the null schemes to the project and cause that behaviour. Also not sure if you might see the null schemes only after restarting Jira. So have a closer look at the schemes ...

srinivas patruni · 1,296 karma ·

Hi Dieter, It is not mentioned in the api that getProjectsNoSchemes method will return array of projects by making the Schemes to null. I also observed that the Default Assignee field is found as Unassigned after updating the projects.

http://docs.atlassian.com/rpc-jira-plugin/4.4/com/atlassian/jira/rpc/soap/JiraSoapService.html#getProjectsNoSchemes(java.lang.String)

So please let me know if there is any better way to fetch all the projects in JIRA for renaming the projects.

Dieter · 10,710 karma ·

What might help is to get the project once again using getProjectByKey before you call updateProject. This might fix the problems with the schemes but would still leave the problem with default assignee. i'd prefer to write a short Groovy script that loops over all projects and updates them on the server. When you install the Groovy script runner plugin there is already a script skeleton displayed in the text box where you can enter the script. I think it s not possible right now with the existing Apis since i also haven't found a Rest api in 4.4. if for some reason you have to do that remotely you could also write your own webservice module or servlet module that just updates the name.

srinivas patruni · 1,296 karma ·

Hi Dieter, Thanks for your information. I have one question.. Regarding the updatiion of projects using soap, is it ia known issue from atlassian side or it is an issue with the api?

Dieter · 10,710 karma ·

IMHO the RPC plugin definitely has a bug since it does not even try to preserve the default assignee. Look at the source code here:

https://studio.plugins.atlassian.com/source/browse/JRPC/tags/atlassian_jira_4_2_m6/rpc-jira-plugin/src/main/java/com/atlassian/jira/rpc/soap/service/ProjectServiceImpl.java?hb=true

The code simply assumes the assignee is null (last argument) !

// result is used later to update project so there cannot be an assignee
com.atlassian.jira.bc.project.ProjectService.UpdateProjectValidationResult result =
               projectService.validateUpdateProject(user, rProject.getName(), rProject.getKey(), rProject.getDescription(),
                       rProject.getLead(), rProject.getProjectUrl(), null);
 

Also the schemes are definitely set to null if the schemes in rProject are null as they are if you get them using getProjectsNoSchemes like you. There should be a corresponding method updateProjectNoSchemes which simply ignores the schemes and also preserves the default assignee of the project.

I could be wrong and might have looked at an outdated version of the RPC plugin but at least the code i have found explains why you lost the schemes.

srinivas patruni · 1,296 karma ·

Thanks for your explaination Dieter!

Looking for something else?

Find Questions…

or Browse other questions tagged:

or Ask a Question