CS-4863: Makes issue repository function more generic

The getLatestByPublication was too specific and also didn't take languages
into account. Now it's more generic and accepts an array as parameters,
where keys should be fields.