@@ -54,8 +54,9 @@ public struct ScreenshotFileReference
5454 public bool removeAfterUpload ;
5555 }
5656
57- public Issue ( string betahubEndpoint , string projectId , string authToken ,
58- MessagePanelUI messagePanelUI , ReportSubmittedUI reportSubmittedUI , GameRecorder gameRecorder )
57+ public Issue ( string betahubEndpoint , string projectId ,
58+ string authToken ,
59+ MessagePanelUI messagePanelUI , ReportSubmittedUI reportSubmittedUI , GameRecorder gameRecorder )
5960 {
6061 _betahubEndpoint = betahubEndpoint ;
6162 if ( ! betahubEndpoint . EndsWith ( "/" ) )
@@ -108,6 +109,7 @@ public Issue(string betahubEndpoint, string projectId, string authToken,
108109 // - autoPublish: (optional) if true, the issue will be requested to be published automatically after media upload.
109110 public IEnumerator PostIssue ( string description , string steps = null ,
110111 List < ScreenshotFileReference > screenshots = null , List < LogFileReference > logFiles = null ,
112+ int releaseId = 0 , string releaseLabel = "" ,
111113 bool autoPublish = false ,
112114 Action < string > onAllMediaUploaded = null , MediaUploadType mediaUploadType = MediaUploadType . UploadInBackground , Action < string > onError = null )
113115 {
@@ -116,6 +118,11 @@ public IEnumerator PostIssue(string description, string steps = null,
116118 throw new Exception ( "Issue instance cannot be reused for posting." ) ;
117119 }
118120
121+ if ( releaseId > 0 && ! string . IsNullOrEmpty ( releaseLabel ) )
122+ {
123+ throw new Exception ( "Cannot set both release ID and release label" ) ;
124+ }
125+
119126 // Initialize state for this posting attempt
120127 _publishRequested = autoPublish ;
121128 _mediaUploadComplete = false ;
@@ -126,7 +133,7 @@ public IEnumerator PostIssue(string description, string steps = null,
126133 string updateIssueAuthTokenLocal = null ;
127134 string error = null ;
128135
129- yield return PostIssueDraft ( description , steps , ( draftResult ) =>
136+ yield return PostIssueDraft ( description , steps , releaseId , releaseLabel , ( draftResult ) =>
130137 {
131138 issueIdLocal = draftResult . IssueId ;
132139 updateIssueAuthTokenLocal = draftResult . UpdateIssueAuthToken ;
@@ -246,13 +253,22 @@ private IEnumerator CheckAndPublishIfReady()
246253
247254 // posts a draft issue to BetaHub.
248255 // returns the issue id and the update issue auth token via callback
249- private IEnumerator PostIssueDraft ( string description , string steps , Action < DraftResult > onResult )
256+ private IEnumerator PostIssueDraft ( string description , string steps , int releaseId , string releaseLabel , Action < DraftResult > onResult )
250257 {
251258 WWWForm form = new WWWForm ( ) ;
252259 form . AddField ( "issue[description]" , description ) ;
253260 form . AddField ( "issue[unformatted_steps_to_reproduce]" , steps ) ;
254261 form . AddField ( "draft" , "true" ) ; // this enables the draft flow
255262
263+ if ( releaseId > 0 )
264+ {
265+ form . AddField ( "issue[release_id]" , releaseId ) ;
266+ }
267+ else if ( ! string . IsNullOrEmpty ( releaseLabel ) )
268+ {
269+ form . AddField ( "issue[release_label]" , releaseLabel ) ;
270+ }
271+
256272 string url = GetPostIssueUrl ( ) ;
257273
258274 using ( UnityWebRequest www = UnityWebRequest . Post ( url , form ) )
0 commit comments