hi
i have a problem in javascript in jira,is it possible to access the value of the current user or reporter in the form before creating issue?
i want to show current user in a feild without possible to edit, i just know this way :
var reporter = document.getElementById('reporter');
so when i dont put reporter feild in the form then i cant use the value of reporter.
how can i reach to value of reporter without putting reporter feild in form??!!!
Community moderators have prevented the ability to post new answers.
Why don't you use a REST call to '/rest/auth/latest/session' which retreives information about the current user. Then use that information to populate the reporter field?
yeah REST is the solution for this issue, i`m reading REST doc now , i have`nt used that before , thanks for your guidance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the easiest way would be to make a call to the REST API from JavaScript and retrieve the value from the server.
http://confluence.atlassian.com/display/JIRA/JIRA+REST+API+(Alpha)+Tutorial
For example, if you make a request to http://jira.atlassian.com/rest/api/2.0.alpha1/issue/JRA-9, you will get back all the available information about the issue, including the reporter details, regardless of what is on the current form. All you'll need is the issue key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can accomplish this with a plugin and one line of code:
- Install the JIRA Toolkit Plugin
- Create a new custom field of the type "Velocity processed Message Custom Field (for view)"
- Set the default value for the context to:
$issue.getReporter().getFullName()
- Add custom field to view screen
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.
yeah REST is the solution for this issue, i`m reading REST doc now , i have`nt used that before,thanks for your guidance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi penny
therefore i cant use javasript for my purpose.
thanks for your answer
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.