query Atlassian SDK C# to create an issue

Hi All,

I have been trying to get this working but no luck yet.

I'm using JiraRestClient method to establish authentication request as shown in my snapshot.

CodewithLatestAtlassianSDK.PNG
When i'm trying to create a new Issue on one of my existing projects "VAC2016" but its throwing me an error 

CodeDebugError.png
I really have a doubt in the way i have defined input parameters for "JIRARestClient" method.

currently we are on Atlassian JIRA cloud and i'm providing cloud URL on http protocol with my credentials.

is it the correct way of defining authentication using JIRARestClient method?

 

Error message says its "Unauthorized".

Can somebody shed some light on?

 

Regards,

Prajwal Shambhu

An unhandled exception of type 'System.Security.Authentication.AuthenticationException' occurred in Atlassian.Jira.dll
Additional information: Response Content: <html>


<head>
    <title>Unauthorized (401)</title>
    






<!--[if IE]><![endif]-->
<script type="text/javascript">var contextPath = '';</script>
<script>
window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};window.WRM._unparsedErrors=window.WRM._unparsedErrors||{};
WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\"\"";
WRM._unparsedData["jira.webresources:feature-flags.feature-flag-data"]="{\"enabled-feature-keys\":[\"jira.plugin.devstatus.smartcommits.dvcs.enabled\",\"nps.survey.inline.dialog\",\"rotp.admin.shortcuts\",\"jira.velocity.engine.warmup\",\"com.atlassian.jira.projects.issuenavigator.cachefix\",\"jira.plugin.devstatus.phasetwo\",\"jira.frother.reporter.field\",\"atlassian.rest.xsrf.legacy.enabled\",\"jira.administration.workflow.validation\",\"ondemand.language.beta\",\"dvcs.connector.smartcommits.disabled\",\"jira.issue.status.lozenge\",\"com.atlassian.jira.config.BIG_PIPE\",\"unified.usermanagement\",\"com.atlassian.jira.projects.issuenavigator\",\"jira.sidebar.components.managecomponents\",\"com.atlassian.jira.config.PDL\",\"jira.plugin.devstatus.phasetwo.enabled\",\"jira.project.config.old.components.screen.disabled\",\"com.atlassian.jira.projects.issue.summary.vignettes\",\"atlassian.aui.raphael.disabled\",\"com.atlassian.jira.config.CoreFeatures.PERMISSIONS_MANAGED_BY_UM\",\"app-switcher.new\",\"frother.assignee.field\",\"jira.onboarding.cyoa\",\"APDEX-517.warmhardcoded\",\"com.atlassian.jira.config.CoreFeatures.ON_DEMAND\",\"atlassian.plugin.aci.enabled\",\"com.atlassian.jira.config.ProjectConfig.MENU\",\"connect.no-applinks\",\"jira.event.mau.logging.disable\",\"rotp.project.create\",\"com.atlassian.plugins.issuenav.SEND_HEAD_EARLY\",\"jira.baseurl.cdn.enabled\",\"fusion.bitbucket.rebrand\",\"ka.SEPARATE_VIEWISSUE\",\"com.atlassian.jira.config.WEB_PANEL_METRICS\",\"sd.new.settings.sidebar.location.disabled\",\"com.atlassian.jira.config.CoreFeatures.LICENSE_ROLES_ENABLED\"],\"feature-flag-states\":{\"sd.reports.custom.drilldown\":true,\"sd.automation.workaround.jira.cached.index.issue\":true,\"jira.feature.flag.board\":true,\"jira.issue.search.jql.indexonly\":true,\"sd.new.settings.sidebar.location\":true,\"sd.automation.if.issue.link.type.phase2\":true,\"sd.automation.issue.linked.phase1\":true,\"sd.experimental.portal.search.algorithm.default.1\":false,\"sd.monitor.plugin.health.check\":false,\"sd.experimental.portal.search.algorithm.default.2\":false,\"sd.automation.issue.status.transitioned\":true,\"jira.shared.searchrequest.search.databaseprimary\":false,\"jira.shared.portalpage.search.indexprimary\":false,\"sd.kb.effectiveness.report\":true,\"sd.custom.email.notifications.batching\":false,\"jira.shared.portalpage.search.indexonly\":true,\"jira.feature.flag.board.polling\":true,\"jira.issue.search.jql.databaseprimary\":false,\"sd.stats.event.tracking\":true,\"jira.shared.searchrequest.search.indexprimary\":false,\"cloud.homepage\":true,\"jira.issue.search.jql.indexprimary\":false,\"jira.instrumentation.laas\":false,\"jira.feature.flag.board.labs\":true,\"jira.shared.portalpage.search.databaseprimary\":false,\"sd.reports.custom.export.dropdown\":true,\"sd.automation.then.linked.issue.comment.phase3\":true,\"sd.custom.email.notifications.single.sending\":true,\"sd.kb.issueview.panel.phase2\":true,\"jira.create.linked.issue\":true,\"sd.kb.issueview.panel\":true,\"sd.approval.requested.when.handler\":false,\"sd.stats.event.cleanup\":true,\"jira.shared.searchrequest.search.indexonly\":true,\"sd.approvals.light.weight\":false,\"sd.kb.usage.report\":true,\"sd.automation.then.webhook\":true,\"sd.request.type.automation.set\":true}}";
WRM._unparsedData["jira.webresources:default-comment-security-level.DefaultCommentSecurityLevelHelpLink"]="{\"extraClasses\":\"default-comment-level-help\",\"title\":\"Commenting on an Issue\",\"url\":\"https://confluence.atlassian.com/display/JIRACORECLOUD/Editing+and+collaborating+on+issues#Editingandcollaboratingonissues-restrictacomment\",\"isLocal\":false}";
WRM._unparsedData["com.atlassian.jira.project-templates-plugin:project-templates-plugin-resources.ptAnalyticsData"]="{\"instanceCreatedDate\":\"2014-12-13\"}";
WRM._unparsedData["com.atlassian.plugins.atlassian-connect-plugin:dialog-options.data"]="{\"dialogOptions\":{},\"inlineDialogOptions\":{},\"dialogModules\":{}}";
WRM._unparsedData["com.atlassian.plugins.atlassian-connect-plugin:jira-date-picker-widget.config"]="{\"dateFormat\":\"%e/%b/%y\",\"dateTimeFormat\":\"%e/%b/%y %I:%M %p\",\"timeFormat\":\"12\",\"firstDay\":1,\"useISO8601WeekNumbers\":false}";
WRM._unparsedData["jira.webresources:dateFormatProvider.dateFormat"]="{\"meridiem\":[\"AM\",\"PM\"],\"eras\":[\"BC\",\"AD\"],\"months\":[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"monthsShort\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],\"weekdaysShort\":[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],\"weekdays\":[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"]}";
WRM._unparsedData["com.atlassian.pocketknife.featureflags-plugin:pocketknife-feature-flags.feature-flag-data"]="{\"enabled-feature-keys\":[\"jira.plugin.devstatus.smartcommits.dvcs.enabled\",\"nps.survey.inline.dialog\",\"rotp.admin.shortcuts\",\"jira.velocity.engine.warmup\",\"com.atlassian.jira.projects.issuenavigator.cachefix\",\"jira.plugin.devstatus.phasetwo\",\"jira.frother.reporter.field\",\"atlassian.rest.xsrf.legacy.enabled\",\"jira.administration.workflow.validation\",\"ondemand.language.beta\",\"dvcs.connector.smartcommits.disabled\",\"jira.issue.status.lozenge\",\"com.atlassian.jira.config.BIG_PIPE\",\"unified.usermanagement\",\"com.atlassian.jira.projects.issuenavigator\",\"jira.sidebar.components.managecomponents\",\"com.atlassian.jira.config.PDL\",\"jira.plugin.devstatus.phasetwo.enabled\",\"jira.project.config.old.components.screen.disabled\",\"com.atlassian.jira.projects.issue.summary.vignettes\",\"atlassian.aui.raphael.disabled\",\"com.atlassian.jira.config.CoreFeatures.PERMISSIONS_MANAGED_BY_UM\",\"app-switcher.new\",\"frother.assignee.field\",\"jira.onboarding.cyoa\",\"APDEX-517.warmhardcoded\",\"com.atlassian.jira.config.CoreFeatures.ON_DEMAND\",\"atlassian.plugin.aci.enabled\",\"com.atlassian.jira.config.ProjectConfig.MENU\",\"connect.no-applinks\",\"jira.event.mau.logging.disable\",\"rotp.project.create\",\"com.atlassian.plugins.issuenav.SEND_HEAD_EARLY\",\"jira.baseurl.cdn.enabled\",\"fusion.bitbucket.rebrand\",\"ka.SEPARATE_VIEWISSUE\",\"com.atlassian.jira.config.WEB_PANEL_METRICS\",\"sd.new.settings.sidebar.location.disabled\",\"com.atlassian.jira.config.CoreFeatures.LICENSE_ROLES_ENABLED\"],\"feature-flag-states\":{\"sd.reports.custom.drilldown\":true,\"sd.automation.workaround.jira.cached.index.issue\":true,\"jira.feature.flag.board\":true,\"jira.issue.search.jql.indexonly\":true,\"sd.new.settings.sidebar.location\":true,\"sd.automation.if.issue.link.type.phase2\":true,\"sd.automation.issue.linked.phase1\":true,\"sd.experimental.portal.search.algorithm.default.1\":false,\"sd.monitor.plugin.health.check\":false,\"sd.experimental.portal.search.algorithm.default.2\":false,\"sd.automation.issue.status.transitioned\":true,\"jira.shared.searchrequest.search.databaseprimary\":false,\"jira.shared.portalpage.search.indexprimary\":false,\"sd.kb.effectiveness.report\":true,\"sd.custom.email.notifications.batching\":false,\"jira.shared.portalpage.search.indexonly\":true,\"jira.feature.flag.board.polling\":true,\"jira.issue.search.jql.databaseprimary\":false,\"sd.stats.event.tracking\":true,\"jira.shared.searchrequest.search.indexprimary\":false,\"cloud.homepage\":true,\"jira.issue.search.jql.indexprimary\":false,\"jira.unified.attachments.m2\":true,\"jira.instrumentation.laas\":false,\"jira.feature.flag.board.labs\":true,\"jira.shared.portalpage.search.databaseprimary\":false,\"sd.reports.custom.export.dropdown\":true,\"sd.automation.then.linked.issue.comment.phase3\":true,\"sd.custom.email.notifications.single.sending\":true,\"sd.kb.issueview.panel.phase2\":true,\"jira.create.linked.issue\":true,\"jira.unified.attachments\":true,\"sd.kb.issueview.panel\":true,\"sd.approval.requested.when.handler\":false,\"sd.stats.event.cleanup\":true,\"jira.attachment.merge\":true,\"jira.shared.searchrequest.search.indexonly\":true,\"sd.approvals.light.weight\":false,\"sd.kb.usage.report\":true,\"sd.automation.then.webhook\":true,\"sd.request.type.automation.set\":true}}";
WRM._unparsedData["com.atlassian.jira.plugins.jira-dnd-attachment-plugin:jira-html5-attach-images-resources.resource-uris"]="{\"deployJava.html\":\"/s/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/4.2.15/_/download/resources/com.atlassian.jira.plugins.jira-dnd-attachment-plugin:jira-html5-attach-images-resources/deployJava.html\",\"clipboard.jar\":\"/s/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/4.2.15/_/download/resources/com.atlassian.jira.plugins.jira-dnd-attachment-plugin:jira-html5-attach-images-resources/clipboard.jar\",\"clipboard-legacy.jar\":\"/s/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/4.2.15/_/download/resources/com.atlassian.jira.plugins.jira-dnd-attachment-plugin:jira-html5-attach-images-resources/clipboard-legacy.jar\"}";
WRM._unparsedData["com.atlassian.applinks.applinks-plugin:applinks-common.applinks-context"]="{\"hostApplication\":{\"id\":\"77c28f3a-117d-35b7-9eb7-720522287e52\",\"type\":\"jira\"}}";
WRM._unparsedData["com.atlassian.applinks.applinks-plugin:applinks-common.applinks-features"]="{\"BITBUCKET_REBRAND\":false,\"V3_UI_OPT_IN\":false,\"V3_UI\":false}";
WRM._unparsedData["com.atlassian.applinks.applinks-plugin:applinks-common.applinks-discovered-features"]="[]";
WRM._unparsedData["com.atlassian.applinks.applinks-plugin:applinks-common.applinks-help-paths"]="{\"entries\":{\"applinks.docs.root\":\"https://confluence.atlassian.com/display/APPLINKS-050/\",\"applinks.docs.diagnostics.troubleshoot.sslunmatched\":\"SSL+and+application+link+troubleshooting+guide\",\"applinks.docs.diagnostics.troubleshoot.oauthtimestamprefused\":\"OAuth+troubleshooting+guide\",\"applinks.docs.delete.entity.link\":\"Create+links+between+projects\",\"applinks.docs.adding.application.link\":\"Link+Atlassian+applications+to+work+together\",\"applinks.docs.administration.guide\":\"Application+Links+Documentation\",\"applinks.docs.oauth.security\":\"OAuth+security+for+application+links\",\"applinks.docs.troubleshoot.application.links\":\"Troubleshoot+application+links\",\"applinks.docs.diagnostics.troubleshoot.unknownerror\":\"Network+and+connectivity+troubleshooting+guide\",\"applinks.docs.configuring.auth.trusted.apps\":\"Configuring+Trusted+Applications+authentication+for+an+application+link\",\"applinks.docs.diagnostics.troubleshoot.authlevelunsupported\":\"OAuth+troubleshooting+guide\",\"applinks.docs.diagnostics.troubleshoot.ssluntrusted\":\"SSL+and+application+link+troubleshooting+guide\",\"applinks.docs.diagnostics.troubleshoot.unknownhost\":\"Network+and+connectivity+troubleshooting+guide\",\"applinks.docs.delete.application.link\":\"Link+Atlassian+applications+to+work+together\",\"applinks.docs.link.applications\":\"Link+Atlassian+applications+to+work+together\",\"applinks.docs.diagnostics.troubleshoot.oauthproblem\":\"OAuth+troubleshooting+guide\",\"applinks.docs.relocate.application.link\":\"Link+Atlassian+applications+to+work+together\",\"applinks.docs.administering.entity.links\":\"Create+links+between+projects\",\"applinks.docs.upgrade.application.link\":\"OAuth+security+for+application+links\",\"applinks.docs.diagnostics.troubleshoot.connectionrefused\":\"Network+and+connectivity+troubleshooting+guide\",\"applinks.docs.configuring.auth.oauth\":\"OAuth+security+for+application+links\",\"applinks.docs.insufficient.remote.permission\":\"OAuth+security+for+application+links\",\"applinks.docs.configuring.application.link.auth\":\"OAuth+security+for+application+links\",\"applinks.docs.diagnostics\":\"Application+links+diagnostics\",\"applinks.docs.configured.authentication.types\":\"OAuth+security+for+application+links\",\"applinks.docs.adding.entity.link\":\"Create+links+between+projects\",\"applinks.docs.diagnostics.troubleshoot.unexpectedresponse\":\"Network+and+connectivity+troubleshooting+guide\",\"applinks.docs.configuring.auth.basic\":\"Configuring+Basic+HTTP+Authentication+for+an+Application+Link\",\"applinks.docs.diagnostics.troubleshoot.authlevelmismatch\":\"OAuth+troubleshooting+guide\"}}";
WRM._unparsedData["jira.webresources:avatar-picker.data"]="{\"isEnabled\":false,\"url\":\"/plugins/servlet/redirectToProfile?target=edit-avatar\"}";
WRM._unparsedData["com.atlassian.jira.jira-header-plugin:dismissedFlags.flags"]="{\"dismissed\":[]}";
WRM._unparsedData["com.atlassian.plugins.helptips.jira-help-tips:common.JiraHelpTipData"]="{\"anonymous\":true}";
WRM._unparsedData["com.atlassian.jira.jira-header-plugin:newsletter-signup-tip.newsletterSignup"]="{\"signupDescription\":\"Stay up-to-date with the latest JIRA tips, tricks, and exclusive inside jokes. All this and more in JIRA Insiders, delivered every month from our inbox to yours.\",\"formUrl\":\"https://www.atlassian.com/apis/exact-target/{0}/subscribe?mailingListId=1239131\",\"signupTitle\":\"JIRA Insiders\",\"signupId\":\"newsletter-signup-tip\",\"showNewsletterTip\":false}";
WRM._unparsedData["com.atlassian.jira.ext.calendar:tipDataProvider.tip"]="{\"suppressTip\":false}";
WRM._unparsedData["jira.webresources:user-message-flags.adminLockout"]="{}";
if(window.WRM._dataArrived)window.WRM._dataArrived();</script>
<link type="text/css" rel="stylesheet" href="//d2p4ir3ro0j0cb.cloudfront.net/inobitsme.atlassian.net/s/f14211ef516de9d893247542a0290ef2-CDN/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/2717a8168e620d6979a7b712bc04a5a9/_/download/contextbatch/css/_super/batch.css?atlassian.aui.raphael.disabled=true&amp;relative-url=true" data-wrm-key="_super" data-wrm-batch-type="context" media="all">
<!--[if lte IE 9]>
<link type="text/css" rel="stylesheet" href="//d2p4ir3ro0j0cb.cloudfront.net/inobitsme.atlassian.net/s/f14211ef516de9d893247542a0290ef2-CDN/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/2717a8168e620d6979a7b712bc04a5a9/_/download/contextbatch/css/_super/batch.css?atlassian.aui.raphael.disabled=true&amp;conditionalComment=lte+IE+9&amp;relative-url=true" data-wrm-key="_super" data-wrm-batch-type="context" media="all">
<![endif]-->
<link type="text/css" rel="stylesheet" href="//d2p4ir3ro0j0cb.cloudfront.net/inobitsme.atlassian.net/s/c53ba5328fc67fe48f4fd6ecf51760cb-CDN/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/39f5457f149cb776590a996424e7e0c4/_/download/contextbatch/css/atl.general,jira.global,jira.general,-_super/batch.css?agile_global_admin_condition=true&amp;atlassian.aui.raphael.disabled=true&amp;hasConnectAddons=true&amp;jag=true&amp;relative-url=true&amp;tempo_is_jira_version_equal_or_greater_than_7.0.0=true&amp;tempo_is_tempo_core_licensed=true&amp;tempo_is_tempo_timesheets_license_valid=false" data-wrm-key="atl.general,jira.global,jira.general,-_super" data-wrm-batch-type="context" media="all">
<script type="text/javascript" src="//d2p4ir3ro0j0cb.cloudfront.net/inobitsme.atlassian.net/s/5574694eb53183bd16a4da808d59e11f-CDN/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/2717a8168e620d6979a7b712bc04a5a9/_/download/contextbatch/js/_super/batch.js?atlassian.aui.raphael.disabled=true&amp;locale=en-US" data-wrm-key="_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script type="text/javascript" src="//d2p4ir3ro0j0cb.cloudfront.net/inobitsme.atlassian.net/s/4a3cd4abc504b801c2c3eeb3bd83b27f-CDN/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/39f5457f149cb776590a996424e7e0c4/_/download/contextbatch/js/atl.general,jira.global,jira.general,-_super/batch.js?agile_global_admin_condition=true&amp;atlassian.aui.raphael.disabled=true&amp;hasConnectAddons=true&amp;jag=true&amp;locale=en-US&amp;tempo_is_jira_version_equal_or_greater_than_7.0.0=true&amp;tempo_is_tempo_core_licensed=true&amp;tempo_is_tempo_timesheets_license_valid=false" data-wrm-key="atl.general,jira.global,jira.general,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script type="text/javascript" src="//d2p4ir3ro0j0cb.cloudfront.net/inobitsme.atlassian.net/s/db3d688ec63f4ace1d8c476e4776ea23-CDN/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/9296915968fd19e3630cf5546b9a3e64/_/download/contextbatch/js/atl.global,-_super/batch.js?atlassian.aui.raphael.disabled=true&amp;locale=en-US" data-wrm-key="atl.global,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<link type="text/css" rel="stylesheet" href="//d2p4ir3ro0j0cb.cloudfront.net/inobitsme.atlassian.net/s/78f21f0833c1ebc1ae3162d7f2c40740-CDN/-srycvj/72002/c2b606d976f1967f744e8fecdf4e13eb/9bb8596866a50ca294e985c53a2ba633/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css?atlassian.aui.raphael.disabled=true&amp;relative-url=true" data-wrm-key="jira.global.look-and-feel,-_super" data-wrm-batch-type="context" media="all">


<script type="text/javascript" src="/rest/api/1.0/shortcuts/72002/29dd2166996497122518e73339b82b53/shortcuts.js"></script>




    <meta name="application-name" content="JIRA" data-name="jira" data-version="1000.5.2">
</head>
<body id="jira" class="aui-layout aui-style-default page-type-message"  data-version="1000.5.2" >
    <div class="aui-page-panel"><div class="aui-page-panel-inner">
            <section class="aui-page-panel-content">
                    <header class="aui-page-header"><div class="aui-page-header-inner">
                            <div class="aui-page-header-main">
                                    <h1>Unauthorized (401)</h1>
                                </div><!-- .aui-page-header-main -->
                        </div><!-- .aui-page-header-inner --></header><!-- .aui-page-header -->
                    <div class="aui-message aui-message-warning warning">
                            <p>Encountered a <code>&quot;401 - Unauthorized&quot;</code> error while loading this page.</p>
                            <p><a href="/secure/MyJiraHome.jspa">Go to JIRA home</a></p>
                        </div>
                </section><!-- .aui-page-panel-content -->
        </div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel -->
</body>
</html>

1 answer

What's the package you use (could not find anything like Atlassian,Jira)?

 Unathorized states that you are not authorized to do the operation, but can you make a query to list some issues? Does that work?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

75 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you