# Script Runner Call REST / Issue as a JSON

**URL:** <https://community.developer.atlassian.com/t/script-runner-call-rest-issue-as-a-json/5237>\
**Category:** Jira Server\
**Created:** [June 16, 2017, 8:26am UTC](https://community.developer.atlassian.com/t/script-runner-call-rest-issue-as-a-json/5237 "2017-06-16T08:26:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardbariny](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@richardbariny](https://community.developer.atlassian.com/u/richardbariny)\
**Post date:** [June 16, 2017, 8:26am UTC](https://community.developer.atlassian.com/t/script-runner-call-rest-issue-as-a-json/5237/1 "2017-06-16T08:26:06Z")

</div>

Hello, I would Like to ask, if I need to convert IssueObject to JSON in scriptConsole, (Issue as a object is not serialized, but there is option in IssueBean object, unfortunetely I can not call IssueBeanBuilder2 because of unavailable of some Manager in script.)

So I decided call JIRA Rest:

rest/api/2/issue?issueId="+issueId  
Problem is I can not call this REST in groovy script as authentificated JIRA logged in user, because ScriptRunner do not use my active credentials.

Question is: Is there any way how to call JIRA Rest from groovy script as actual logged in user?  
Or some other way how to convert JIRA Issue object to JSON?

Possible ways:  
[https://developer.atlassian.com/static/javadoc/jira/6.4/reference/com/atlassian/jira/rest/v2/issue/IssueBeanBuilder2.html](https://developer.atlassian.com/static/javadoc/jira/6.4/reference/com/atlassian/jira/rest/v2/issue/IssueBeanBuilder2.html)  
[https://developer.atlassian.com/static/javadoc/jira/6.4/reference/com/atlassian/jira/rest/v2/issue/IssueBean.html](https://developer.atlassian.com/static/javadoc/jira/6.4/reference/com/atlassian/jira/rest/v2/issue/IssueBean.html)
