I want to get ApplicationUser object, And i have 'IssueEvent event' and i have 'event.getUser'.
i am trying to do AttachmentManager.createAttachment(CreateAttachmentParamBean)
jira version 6.0.1 api version 4.2
where
public CreateAttachmentParamsBean(File file, String filename, String contentType, ApplicationUser author, Issue issue, Boolean zip, Boolean thumbnailable, Map<String,Object> attachmentProperties, Date createdTime, Boolean copySourceFile)
requires 'ApplicationUser author' .
I have tried this:
ApplicationUser applicationUser =
new DelegatingApplicationUser(key,user);
DelegatingApplicationUser(String key, com.atlassian.crowd.embedded.api.User user)
what is key how do i get it?
Community moderators have prevented the ability to post new answers.
Hi Sohil
try somthing like this:
import com.atlassian.crowd.embedded.api.User; import com.atlassian.jira.user.ApplicationUser; final String sEventUser; final User eventUser = issueEvent.getUser(); if (eventUser == null) { ... your error handling } else { sEventUser = eventUser.getName(); } final ApplicationUser appUser = ApplicationUsers.from(eventUser);
I hope this can help you.
Regards,
Uli
Thanks Ulrich but tell me what is this code doing??
if (eventUser == null) { ... your error handling } else { sEventUser = eventUser.getName(); }
and what is the use of
sEventUser
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sohil,
I used the string sEventUser later in my plugin for logging.
I think you need only the line:
final ApplicationUser appUser = ApplicationUsers.from(eventUser);
Sorry if I confused you.
Regards,
Uli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ulrich,
How can i get ApplicationUsers??
final
ApplicationUser appUser = ApplicationUsers.from(eventUser); is giving me error to declare
ApplicationUsers class.
its not importing ApplicationUsers class
Please suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.